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

Hypertext linking a Form 'Submit' button 2

Status
Not open for further replies.

starfishh

Programmer
Mar 23, 2001
20
0
0
GB
Im trying to place a link at the end of a form so when the user submits the form using a standard submit button the page being viewed is updated to a new page which displays a thankyou message and return link to homepage. The form is being submitted using the mailto action.

When the submit button is clicked an alert box warns of revealing email address to receipient and then returns you to the form.

I have tried using a simple <A HREF> tag to surround the Input tag containing the submit button and also using a call to a script to update the document.src

How can I have the page automatically update when the user submits the form via a mailto action?
 
Try this and it will make your link submit your form when you clicked it.

<form name=&quot;myform&quot; id=&quot;myform&quot; action=&quot;myaction&quot;>
<a href=&quot;mailto:myemail@mydomain.com&quot; onclick=&quot;document.myform.submit();&quot;>Mail me</a>
<form>


Djon
 
This is definetley a cool way of submitting a form and also another method of using an image instead of the normal submit button I guess.

However I still can't get the browser to update the page on submitting the form. The user is just returned to the form page.

I'm using the action attribute in the form

<form name=&quot;myform&quot; id=&quot;myform&quot; action=&quot;thanks.html&quot;>

Is this the correct syntax for the action attribute and if so why doesn't the browser update to the new page thanks.html?

starfishh
happy.gif
 
<form name=&quot;myform&quot; id=&quot;myform&quot; action=&quot;thanks.html&quot; method=&quot;post&quot;>

you forgot to tell it which method you want to use. :)

your options are &quot;post&quot; and &quot;get&quot; --

post sends the variables &quot;transparently&quot;, and &quot;get&quot; sends them via query string (i.e. somepage.asp?var1=val1)

good luck!
Paul Prewett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top