954,116 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Buttons

hi good day to all.

im new in ASP and one of my questions now is:

is it possible to have 2 command buttons in one asp page?
if possible how can i separate their actions in one form?
wherein the first button will give the total no. of students
and the second one will give me the total no. of teachers

please...i badly need you help. thanks a lot in advance.

vhinehds
Light Poster
29 posts since May 2005
Reputation Points: 11
Solved Threads: 0
 

I hope the below code helps.

<%
If Request("num_student") = "1"  Then
  Response.Write "Number of student button was clicked."
  ' add your other script here
else 
  Response.Write "Number of teacher button was clicked."
  ' add your other script here
End If
%>
<form name="form1" action="" method="post">
<input type="hidden" name="num_student" value="1">
<input type="submit" value="Number of Student">
</form>
<form name="form2" action="" method="post">
<input type="hidden" name="num_teacher" value="1">
<input type="submit" value="Number of teacher">
</form>
zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

I hope the below code helps.

<%
If Request("num_student") = "1"  Then
  Response.Write "Number of student button was clicked."
  ' add your other script here
else 
  Response.Write "Number of teacher button was clicked."
  ' add your other script here
End If
%>
<form name="form1" action="" method="post">
<input type="hidden" name="num_student" value="1">
<input type="submit" value="Number of Student">
</form>
<form name="form2" action="" method="post">
<input type="hidden" name="num_teacher" value="1">
<input type="submit" value="Number of teacher">
</form>

*******************************************************

hi zippee!

its great, although the sample code is simple but good enough to understand and manipulate...thanks a lot for that one.

vhinehds
Light Poster
29 posts since May 2005
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You