Forum Moderators: coopster

Message Too Old, No Replies

posting form data with a link instead of submit

         

michlcamp

8:16 pm on Jul 31, 2005 (gmt 0)

10+ Year Member



Is there a way to send form data , including hidden fields, by using a link instead of a submit button?

I'm using

<form action="http://mysite.com/successpage.php" method="POST" target="_top">

at the top of the form and have several hidden fields that need to post to the next page.

probably an old question, but I don't have the answer handy...
thanks in advance..
mc

mcibor

8:30 pm on Jul 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only method I know is using javascript:

<form id="form_id" name="form_name" action=... method=...>
<a href="javascript: document.form_name.submit();">

or

<a href="javascript: getElementById("form_id").submit();">

Best regards
Michal Cibor

JJao

8:32 pm on Jul 31, 2005 (gmt 0)

10+ Year Member



If you use the parameters and values which you fill your inputs with (hidden or not) to build an URI along the way of '.../page.php?parameter1=value1&parameter2=value2&...' you can, I suppose.

But with a few downsides like size, visibility, SEO unfriendliness (and probably more).
What's your reason for not using the form?