Submitting by selectng a image or icon

liunx

Guest
This is probably a pretty stupid question, but how do I create a form where the form is submitted to the action page when the user clicks on a image or icon (and not a button).<br />
<br />
For example (display page):<br />
<br />
<A HREF=http://www.htmlforums.com/archive/index.php/"ActionPage.cfm">GO!</A><br />
<FORM ACTION="ActionPage.cfm" METHOD="post"><br />
<INPUT TYPE="text" NAME="test1"><br />
<BR><br />
<BR><br />
<INPUT TYPE="submit"><br />
</FORM><br />
<br />
Action page:<br />
<br />
<CFOUTPUT>#form.test1#</CFOUTPUT><br />
<br />
So, if I submit the form via the button, it will work fine, but if I click on the A HREF tag, I get an error (because the form was not submitted).<br />
<br />
Any ideas on how to set this up so that clicking on the A HREF will also submit the form?<!--content--><a href=http://www.htmlforums.com/archive/index.php/"#" onClick="javascript: document.formname.action='http://actionPage.htm'; document.formName.method='post';document.formName.submit();">Submit</a><!--content-->Worked like a charm.<br />
<br />
Much appreciated!<!--content-->
 
Back
Top