Buttons

Reply

Join Date: May 2005
Posts: 29
Reputation: vhinehds is an unknown quantity at this point 
Solved Threads: 0
vhinehds's Avatar
vhinehds vhinehds is offline Offline
Light Poster

Buttons

 
0
  #1
Jun 6th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: Buttons

 
0
  #2
Jun 7th, 2005
I hope the below code helps.
  1. <%
  2. If Request("num_student") = "1" Then
  3. Response.Write "Number of student button was clicked."
  4. ' add your other script here
  5. else
  6. Response.Write "Number of teacher button was clicked."
  7. ' add your other script here
  8. End If
  9. %>
  10. <form name="form1" action="" method="post">
  11. <input type="hidden" name="num_student" value="1">
  12. <input type="submit" value="Number of Student">
  13. </form>
  14. <form name="form2" action="" method="post">
  15. <input type="hidden" name="num_teacher" value="1">
  16. <input type="submit" value="Number of teacher">
  17. </form>
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 29
Reputation: vhinehds is an unknown quantity at this point 
Solved Threads: 0
vhinehds's Avatar
vhinehds vhinehds is offline Offline
Light Poster

Re: Buttons

 
0
  #3
Jun 8th, 2005
Originally Posted by zippee
I hope the below code helps.
  1. <%
  2. If Request("num_student") = "1" Then
  3. Response.Write "Number of student button was clicked."
  4. ' add your other script here
  5. else
  6. Response.Write "Number of teacher button was clicked."
  7. ' add your other script here
  8. End If
  9. %>
  10. <form name="form1" action="" method="post">
  11. <input type="hidden" name="num_student" value="1">
  12. <input type="submit" value="Number of Student">
  13. </form>
  14. <form name="form2" action="" method="post">
  15. <input type="hidden" name="num_teacher" value="1">
  16. <input type="submit" value="Number of teacher">
  17. </form>
*******************************************************

hi zippee!

its great, although the sample code is simple but good enough to understand and manipulate...thanks a lot for that one.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC