Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve info about form and button at onSubmit

Status
Not open for further replies.

markgargan

Programmer
Apr 4, 2005
25
IE
Hey folks,

A page has a number of forms with a different submit button
for each.

Is there anyway of handling the onSubmit() function so that
we retrieve and send to the next page, the name of the form
which was submitted and the name of the button.

the code might look something along the lines of this.


function onSubmit() {

<!-- Get the name of the form that was submitted -->
formName = document.getNameSubmittedForm();

<!-- Get the name of the button that was pressed-->
buttonName = document.getFormSubmitted().getButtonPressed();

<!-- Insert in the variable 'formName' the eh.. formName-->
document.getForm(formName)['formName'] = formName;
<!-- Insert in the variable 'buttonPressed' the name of the button pressed-->
document.getForm(formName)['buttonPressed'] = buttonPressed;

document.getForm(formName).submit();
}

Any help would be greatly appreciated.

Thanks,
Mark.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top