custom form button

liunx

Guest
now if I have a imple html form, in orde for it to get submitted I need to have a submit button <br />
<input type = "submit"><br />
<br />
I was wondering if there is a way to have a custom image as the button and to have the form be submitted whn the user clicks on the image. How can this be achieved (with or without Javascript)<!--content-->Try this:<br />
<br />
<button type="submit" name="submit" value="Submit"><img src=http://www.webdeveloper.com/forum/archive/index.php/"submitimg.gif"/>Submit</button><!--content-->If you go here<br />
<!-- m --><a class="postlink" href="http://matrix.csis.pace.edu/~s03-cs389-s07/index.html">http://matrix.csis.pace.edu/~s03-cs389-s07/index.html</a><!-- m --><br />
and click on the login you can see that the button has the graphic on top but still has the grey area behind it. How can I get rid of that? Also I do wish to have the imag be a roll over with Javascript, so how can I have the form get submitted within a javascript function<!--content-->I think you are going to have to run a function, then. Try something like this:<br />
<br />
<head><br />
function submitform()<br />
{<br />
document.formname.submit();<br />
}<br />
</head><br />
<body><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"enablejavascript.htm" onclick="submitform(); return false;"><img src="your.gif"/></a><!--content-->the actual way to do this would be as follows.<br />
<br />
<input type=img src=http://www.webdeveloper.com/forum/archive/index.php/submitimage.gif><!--content-->Will that allow for rollovers?<!--content-->hmm. good point. i guess it would work<br />
<br />
<input type=image src=http://www.webdeveloper.com/forum/archive/index.php/submitimage.gif onMouseOver="whatever();"><br />
<br />
But if it doesn't, you could always put span tags around it<br />
<br />
<span onMouseOver="whatever();"><input type=image src=http://www.webdeveloper.com/forum/archive/index.php/submitimage.gif></span><!--content-->o and oops, i messed up on my frist post in this thread. its NOT <input type=img><br />
<br />
it IS<br />
<input type=image><!--content--><html><br />
<br />
<head><br />
<br />
<title>Welcome to Adobe GoLive 6</title><br />
<SCRIPT language="JavaScript"> <br />
<!--hide <br />
function submitForm()<br />
{<br />
document.login.submit();<br />
}<br />
//--><br />
</SCRIPT><br />
<br />
</head><br />
<form action="http://matrix.csis.pace.edu:16143/pace/servlet/loginForm" method="post" name="login"><br />
<br />
<body bgcolor="#ffffff"><br />
<p>This is the log in page</p><br />
<p>Please enter your username and password:</p><br />
<p>username <input type="text" name="username" size="24" border="0"></p><br />
<p>password <input type="text" name="password" size="24" border="0"></p><br />
<img src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"submitoff.jpg" name="button" onClick = "javascript:submitFrom()"></a> <br />
<br />
<br />
<br />
<br />
</body><br />
</form><br />
</html><br />
<br />
error: Line 25 (theone with the javascript:submitForm())<br />
char 1<br />
Error: Object Expected<br />
<br />
Any idea how to fix this?<!--content-->Typo on submitForm(). You have submitFrom().<!--content-->Thank you, I am an idiot. Thanx for the help and the quick response time<!--content-->Change it to this:<br />
<br />
<br />
<html><br />
<head><br />
<title>Welcome to Adobe GoLive 6</title><br />
</head><br />
<form action="http://matrix.csis.pace.edu:16143/pace/servlet/loginForm" method="post" name="login"> <br />
<br />
<body bgcolor="#ffffff"> <br />
<p>This is the log in page</p> <br />
<p>Please enter your username and password:</p> <br />
<p>username <input type="text" name="username" size="24" border="0"></p> <br />
<p>password <input type="text" name="password" size="24" border="0"></p> <br />
<input type=image src=http://www.webdeveloper.com/forum/archive/index.php/imageoff.jpg> <br />
</form><br />
</body><br />
</html><!--content-->
 
Back
Top