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

form submit using javascript

Status
Not open for further replies.

Reet81

Programmer
Jul 11, 2006
3
GB
Hi,

I am aware that you can use the following:

document.myform.submit();

to submit a form in javascript but I was wondering if you could also indicate the action. I want to post the form using javascript and actioned as action="mailto:email@nowhere.com".

Is there a way of doing this?

Many thanks

Reet :)
 
Why not just do it?
[tt] document.myform.action="mailto:email@nowhere.com";
document.myform.submit();
[/tt]
 
Be sure that you don't have a form element with the name of action. Believe it or not... I once spent several hours unravelling a bug that was due to an attempt to set the action (as Tsuji suggests) only to find that it was actually setting a form element called action.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
You're not the only one Jeff. I've done the very same thing. Extremely frustrating to debug!

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top