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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input type=image

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
does anyone know a way to get input type=image to pass a value? input type=submit will use the value attribute but input type=image does not seem to????
 
Add a hidden field to your form:

<input type=&quot;hidden&quot; name=&quot;replacement&quot; value=&quot;the value that image won't accept.&quot;>

Rick -----------------------------------------------------------
 
well see this is the deal- I want to submit ONE form with all the hidden fields and such but have one variable change based on which button is pushed... this will work with <input type=&quot;submit&quot; but not <input type=&quot;image&quot;

????????
 
<script>
function subForm(inField){
document.myForm.buttonField.value = inField
document.myForm.submit()
}
</script>
<form name=myForm>
<a href=&quot;#&quot; onClick=&quot;subForm('value1')&quot;>
<img src=button1.gif>
</a>
<a href=&quot;#&quot; onClick=&quot;subForm('value2')&quot;>
<img src=button2.gif>
</a>

<input name=buttonField type=hidden> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top