Hey all!
I want too set an image as a submit button on a form !!
Any ideas
Cheers
<form name="myform" action="yourscript.php"> Enter your name : <input name="name" value=""> <a href="#" onClick="document.myform.submit();"><img src="myimage.jpg" border="0"></a> </form>
Curtosey of javascriptsource.com:
<form name="theForm"> <!-- Put your form code here //--> <input type="text" name="formInput"> <!-- End of form code //--> <a href="javascript:document.theForm.submit();"><img src="img.jpg" border="0"></a> </form>
Or:
<form name="bleh" action="we.php" method="post"> Login: <input type="text" name="user"> <input type="image" src="images/buttons/login.gif"> </form>
However I'm not sure of the compatibility with browsers when doing it this way.
For those programming for situations where javascript may be disabled:
<form name="test" action="someotherpage" method="post"> <input type="text" name="field1"> <input type="image" name="uhoh" src="urltoimg"> </form>