|
-
Jul 12th, 2000, 01:31 PM
#1
Thread Starter
Member
I have a html form with, suppose, 3 submit buttons,how do i proceed to know (on the server side) wich one has been pressed ?
-
Jul 12th, 2000, 01:55 PM
#2
Addicted Member
use the onmousedown event of each button to fill a hidden form field with a string which identifies the button. then you can retrieve this hidden field upon submission.
dvst8
Secret to long life:
Keep breathing as long as possible.
-
Jul 12th, 2000, 02:00 PM
#3
Thread Starter
Member
-
Jul 12th, 2000, 02:24 PM
#4
Addicted Member
no prob
i figured out how to do this 2 days ago
Secret to long life:
Keep breathing as long as possible.
-
Jul 13th, 2000, 02:18 AM
#5
Frenzied Member
But some browsers don't support onmousedown
Yoiu could do somthing like this though:
Code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<script language='Javascript'>
function postit(str){
document.frm1.txtKey.value=str;
//alert(str);
document.frm1.submit();
}
</script>
</HEAD>
<BODY>
<%
Response.Write request("txtKey") & " was pressed"
%>
<form name="frm1" action="ch.asp"><!--POST BACK TO ITSELF -->
<input type=hidden name="txtKey">
<INPUT type=button onclick="postit(this.name);" name="button1" value="button1">
<INPUT type=button onclick="postit(this.name);" name="button2" value="button2">
</form>
</BODY>
</HTML>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|