Discussions
Button text changing javascript
I've got a script that changes the text on an item's button based on the item's name. For us, most buttons say "Donate now" but some say "Sponsor me" and some are hidden.
It used to work fine, but I've been changing this on an item-by-item basis. Is there a way to reference an item's parent category in a client-side script? It'd be great if I could change the button if the item is a sub of a larger category (not web site category).
This is the script right now:
<script>
var aForm = document.forms;
for(var i=0;i<aForm.length;i++){