Hi, It's very hard to tell what you are trying to do from looking at just the JavaScript. Can you post some HTML and a short explanation of what you want to achieve.
jQuery has a built in toggle function that shows hidden elements and hides visible ones. So your second function would be coded something like this to toggle visibility of all <p> elements: $("p").toggle(); Paul On Nov 26, 12:41 am, halcyonandon <[EMAIL PROTECTED]> wrote: > I've been reading the jQuery documentation and trying to improve this > function(well functions) and its siblings, however I'm running into > all sorts of syntactical errors when I make changes past this point. > For example, I know there is a better way to write this.elements > ['activities[ActivitiesTab]'].value = ckd; or var radios = > document.forms['ActivitiesTab'].elements['activities[ActivitiesTab]']; > > But the biggest issue is I know there are alternatives to statements I > make that can be much shorter and faster with jQuery, but any attempts > I make just seem to break it. Any insight into this issue would be > appreciated, thanks! > > initActivityForms: function() { > var radios = document.forms['ActivitiesTab'].elements > ['activities[ActivitiesTab]']; > $(actids).each(function(i) { > var fmName = 'ticketSearchForm' + actids[i].ucFirst(); > var fm = document.forms[fmName]; > $(radios[i]).click(function() { > $.bots.toggleASF(actids[i]); > }); > $(fm).submit(function() { > $(radios).each(function(i) { > if (radios[i].checked) { > ckd = radios[i].value; > } > }); > this.elements['activities[ActivitiesTab]'].value = > ckd; > }); > }); > radios[0].checked = true; > }, > toggleASF: function(actid) { > $(actids).each(function(i) { > var obb = $('#' + actids[i]); > if (actid == actids[i]) { > $(obb).show(); > } else { > $(obb).hide(); > } > }); > },