Custom javascript to reference multiple groups

aksmith

Member
Hello:
I am building a time card application that includes several (non-repeating) groups, including one for each day the week:
newcardmonday
newcardtuesday
etc.
I have a toggle radio button field that gives the user the option of filling out one set of fields for the entire week OR going through each day.
The form should open with the individual day groups hidden so they can will show only if needed.
The built-in hide/show options (values = 1/2) work okay for the onload and change events, but I would prefer to use custom javascript so I can keep all the event managers in one place. It's kind of painful to have to grind through the GUI especially since I need to use this same method throughout the rest of the form (CRUD, please help me...).
The first group (newcardmonday - with prefix, sul4t_newcardmonday) has a DOM id of 'group10'.

I have tried the load event with:
var sameJob = this.getValue();
if (sameJob == '1') {
document.id('group10').hide();
}

and:

var sameJob = this.getValue();
var group10 = document.id('group10');

if (sameJob == '1') {
group10.hide();
}

not to mention various other ways of grabbing the DOM element with jquery and with Fabrik.getBlock('form_7').formElements etc.

I have had good luck manipulating elements with custom javascript, but I am unable to touch the group DOM object.
If adding an external js file makes more sense, i'm all for that because I also have to build a complex sum calculator that traverses up to 48 fields, so that's the direction I will ultimately head for.

Thanks in advance for your help!
Cheers,
Alan
 
As with any JS code question, we have to be able to see your page. Trying to help with JS without that is like trying to diagnose a car problem in sign language over the phone. If we need a login, fill out your My Sites ... if not, just point us at the page.

-- hugh
 
Hugh:
See my sites for access. Thank you very much!
The element id = 133 (Group = New Time Card).
I'm about ready to upgrade to Pro support as soon as I can block out time to take advantage of it.

Cheers!
Alan
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top