Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning a value to <input type='IMAGE'>

Status
Not open for further replies.

mdr227

Programmer
Nov 17, 2000
114
US
On a form I designing I am trying to use images for the submit buttons I will be using instead of the standard HTML button. The problem I am running into is with the <Input type='Submit'> tags I can assign a value to the button such as <Input type='Submit' name='add_delete' value='Delete Record'>. How can I do this using an <Input Type='Image'> tag?
 
Well it turns out you can just use it like any other form element, and insert:
value=&quot;some value&quot;
in the image tag.

e.g.
<form>
<input type=&quot;image&quot; src=&quot;LUNAR.gif&quot; value=&quot;I am an image!&quot; onClick=&quot;document.write(this.value)&quot;></form>



You can also achieve submit or reset functions by calling:
document.formName.submit();
document.formName.reset();
&quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top