Does anyone know the html script to set an image as a submit button? (I guess it would be the same for the reset button:-))
I can remember it :-( for not using it for a while...
Thanks a lot,
Fred.
Does anyone know the html script to set an image as a submit button? (I guess it would be the same for the reset button:-))
I can remember it :-( for not using it for a while...
Thanks a lot,
Fred.
i think something like this :
<form action="test.php" method="testform" name="testForm">
<img src="images/button.gif" border="0" onclick="this.document.testform.submit()">
</form>
I havent tested, but it could also be just like document.testform.submit()
Regards
Andreas
<input src="/path/to/img.ext">
In the form target I think you need to change the periods in the GET field for the img to underscores. Forget exactly how it works though
geoff
the first method is almost right. sometimes browser can be akward and want the javascript declaring. Something like
<form action="test.php" method="testform" name="testForm">
<img src="images/button.gif" border="0" onclick=" javascript:this.document.testform.submit()">
</form>
Mark.
Thanks a lot. I'm gonna have a look at it right now and will let you know about it;-)
Best Regards,
Fred.
The problem with the JavaScript method lies in the fact that it absolutely relies on that JavaScript for the form submission to work. JavaScript is great for visual fluff and quick, user-friendly form validation, but it should never by relied upon for application critical events like data validation or form submission. Puts too much control over your app in teh hands of your user (bad programming practise #1).
My thoughts... not yours.
geoff
Yes, it's nice but how should I do?
Fred.
It doesn't work... don't know why...
I've tried to put the submit() action in a <a href> tag, but it the same: nothing happens.
<form name="digi" action="myScript.php" method="post">
<a href="javascript:this.document.digi.submit();" onMouseover="m_over('11');" onMouseout="m_out('11');"><img name="SubmitButton" src="myButton.gif" width="35" height="32" border="0"></a>
<input type="hidden" name="myVal" value="val">
</form>
---myScript.php
<?php
if($myVal)
{echo $myVal;}
else
{echo "@!#$! It still doesn't work!";}
?>
everything else is running perfectly now... I just need to pass this step before I become nuts:-)
The php code is not called...
I tried putting the submit() function in a onClick event instead of the href param, but...the same hell.
I got it!
The problem wasn't the code but the fact that I tested it via Dreamweaver (preview in browser).
I just tested it on an apache server, and it works very well :-)
Thanks a lot to each of you,
Best Regards,
Fred.