943,910 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 2257
  • ASP RSS
Jun 6th, 2005
0

Buttons

Expand Post »
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.
Similar Threads
Reputation Points: 11
Solved Threads: 0
Light Poster
vhinehds is offline Offline
29 posts
since May 2005
Jun 7th, 2005
0

Re: Buttons

I hope the below code helps.
ASP Syntax (Toggle Plain Text)
  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>
Reputation Points: 10
Solved Threads: 7
Posting Whiz in Training
zippee is offline Offline
294 posts
since Jan 2005
Jun 8th, 2005
0

Re: Buttons

Quote originally posted by zippee ...
I hope the below code helps.
ASP Syntax (Toggle Plain Text)
  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.
Reputation Points: 11
Solved Threads: 0
Light Poster
vhinehds is offline Offline
29 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: pws setup
Next Thread in ASP Forum Timeline: Database and ASP loops and hierarachal Data





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC