Use Image as the submit button in JavaScript
Description
The following code shows how to use Image as the submit button.
Example
<!--from ww w . j ava2 s . c o m-->
<!DOCTYPE html>
<html>
<head>
<title>Submit Example</title>
</head>
<body>
<form id="form1" method="post" action="javascript:alert('Submitted')">
<!-- regular textbox -->
<label for="txtName">Name:</label><br />
<input type="text" id="txtName" name="txtName" /><br />
<!-- submit button -->
<input type="image" src="http://www.java2s.com/style/logo.ico" />
</form>
</body>
</html>
The code above generates the following result.
Javascript Tutorial Button
Access form button with its name through do...
Access form with form name through document...
Add click action to a Button in JavaScript
Add click event handler for input button in...
Add click event handler to input onClick ev...
Change input button color and background co...
Get current value of the submit button whic...
List properties from a form button in JavaS...
Return false in form button click event to ...
Access form button with its name through do...
Access form with form name through document...
Add click action to a Button in JavaScript
Add click event handler for input button in...
Add click event handler to input onClick ev...
Change input button color and background co...
Get current value of the submit button whic...
List properties from a form button in JavaS...
Return false in form button click event to ...