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

multiple image submit buttons 1

Status
Not open for further replies.

aarrgghh

Technical User
Sep 5, 2002
60
US
Hey all,

I need to have multiple image submit buttons on a page, and I need to pass different values, via GET or POST, based on the button clicked.

Thanks in advance
 
<form method=&quot;GET&quot;>
<input type=&quot;hidden&quot; name=&quot;h1&quot;>
<input type=&quot;image&quot; onclick=&quot;this.form.h1.value='test1'&quot;>
<input type=&quot;image&quot; onclick=&quot;this.form.h1.value='test2'&quot;>

Adam
 
Here's what I have tried:
// method one

function name(){
document.form.control.value = 'value';
document.form.submit();
// I have also used &quot;return false&quot; here
}

<form method=&quot;GET&quot;>
<img src=&quot;image&quot; onClick=&quot;name()&quot;
</form>

// method two
<form method=&quot;GET&quot;>
<input type=&quot;hidden&quot; name=&quot;h1&quot;>
<input type=&quot;image&quot; onclick=&quot;this.form.h1.value='test1'&quot;>
<input type=&quot;image&quot; onclick=&quot;this.form.h1.value='test2'&quot;>

Any other ideas? Thanks again.
 
OK now I have it working in Firebird and IE, but not Netscape. Here is the code I am using.

function funk(){
window.document.form1.control.value = &quot;value&quot;;
window.document.form1.submit();
}
<form method=&quot;GET&quot;>
<input type=&quot;hidden&quot;>
<img src=&quot;images/back.gif&quot; onClick=&quot;funk()&quot;>
</form>

Any reason why this isn't working in Netscape?

Thanks
 
Got it. No onClick available for Netscape 4.7. Need to <a href=&quot;3&quot; onClick=&quot;funk()&quot;><img src></a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top