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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Triggering Submit action without clicking submit

Status
Not open for further replies.

ahmun

IS-IT--Management
Jan 7, 2002
432
US
Hi all,

I'm wondering if there is a way to create a javascript function to trigger an HTML Form's submit event without clicking the submit button.

I have a form with a List box (Select tag) and the user selcts from the list and clicks submit... then to some other action...

I wanted to add another level of usability by enabling the user to double-click the selection and have the form submit that selection.

Any insights on if this is possible? or how can this be done?

I've thought of using javascript and the onDblClick event, and collecting all the form's different elements, then stuffing them in a redirect URL with its parameter jammed full of the form's element names and values. But that would be double work, because the form's action already goes to an ASP page with a bunch of code... and I don't want to code the whole routine with a bunch of added if statements to see if the values were sent via the URL parmeters or via the submit...

Earnie Eng
 
onDblClick="function1();formName.submit();"

The idea of function1() is to make sure the form field you are double-clicking takes the value of the element on which you're clicking before submission takes place. I've never tried adding double-clicking functionality before, so I don't know if that is actually necessary.

Good luck.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top