larsonr
07-12-2005, 08:39 PM
Situation:
A single page having two forms... form1 and form2
A left nav of links.
The links all call a javascript function called "triggerSubmit()".
Based on the link selected, I need to save a unique value to a form.
the function:
function triggerSubmit(someValue) {
document.formName.uniqueValue.value=someValue;
document.formName.submit();
}
The link:
<a href="javascript:triggerSubmit('gblNavigationAction');">Link Text</a>
Because the left nav is included on many pages each having it's own form(s),
How can I make the function triggerSubmit more dynamic to determine the form names on a page? -and/or- if no form exists how do I check that also with the mindset of being more dynamic and not hard coded... I don't wish to copy the function on every page and customize it.
Any tips would be appreciated...
Thanks upfront for your assist!
-Ron
A single page having two forms... form1 and form2
A left nav of links.
The links all call a javascript function called "triggerSubmit()".
Based on the link selected, I need to save a unique value to a form.
the function:
function triggerSubmit(someValue) {
document.formName.uniqueValue.value=someValue;
document.formName.submit();
}
The link:
<a href="javascript:triggerSubmit('gblNavigationAction');">Link Text</a>
Because the left nav is included on many pages each having it's own form(s),
How can I make the function triggerSubmit more dynamic to determine the form names on a page? -and/or- if no form exists how do I check that also with the mindset of being more dynamic and not hard coded... I don't wish to copy the function on every page and customize it.
Any tips would be appreciated...
Thanks upfront for your assist!
-Ron