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

Buttons 1

Status
Not open for further replies.

Ablecken

Programmer
Jun 5, 2001
130
US
I need to have the user click on three buttons and then a fourth. The fourth cannot be clicked untill the other three are done. how would i do this? i dont know how to handle button clicks in asp.
 
Probably the solution does not involve the ASP script. This sounds like something to handle with client-side javascript. Do you want this control effective before the form is submitted? Then write a validation script to run onsubmit to check whether the right buttons were pushed, excuse me, clicked.

Or are you submitting after each button is clicked? In this case, just keep track of which buttons have been clicked. Use session variables or generate hidden fields based on what is submitted from the form.

For example,

In the initial form -
Code:
<form name=&quot;myForm&quot;. . .  method=&quot;post&quot; . . .>
 . . .
<input type=&quot;button&quot; name=&quot;feed_me&quot; onclick=&quot;feed_me()&quot;>
<input type=&quot;submit&quot;>

<script>
function feed_me(){document.myForm.value = &quot;i_was_clicked&quot;;}
</script>

In the receiving script -
Code:
if(Request.Form(&quot;feed_me&quot;).value == &quot;i_was_clicked&quot;){

//Do what is needed when this button is clicked.
//  Maybe rebuild original form as it was  if it is not
//  time to click the feed_me button
//  Or proceed with the step appropriate to clicking this button.
}


//Somewhere keep track to the fact that the feed_me button was clicked.  A session variable is most convenient.

Session(&quot;feed_me&quot;) = Request.Form(&quot;feed_me&quot;).value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top