Topic: How can I make decreasing options in form - radio buttons

I have a form with radio buttons… I want to set how many times the options can be picked. Example:
<form name="form1" method="post" action="cart.html">

      <label>
      <input type="radio" name="info" value="11/23/2008+2pm-3pm" >
    2pm-3pm</label>
      <br>
      <label>
      <input type="radio" name="info" value="11/23/2008+3pm-4pm">
    3pm-4pm</label>
      <br>
 
  <p>      <input type="submit" name="method" value="choose"/>
  </p>
</form>

For the 2pm-3pm time I want users to only be able to pick the 2pm-3pm 4 times, for the '3pm-4pm' time- only 5 times….When the 2pm-3pm has been picked 4 times that option disappears. I want to be able to entre how many orders per radio button...
And as the orders fill up the remaining orders decrease and option eventually disappears form frontend...
How is this possible to do? Do I need to put a Id on each radio button?

Re: How can I make decreasing options in form - radio buttons

So, basically, you want to cap the number of orders per day? Not per individual user, but for all users? So, for example, if the 2pm-3pm has been picked 4 times, the fifth user who tries to see the form won't see that option?

If so, sounds like PHP is the way to go, either with a database of some sort to count the number of times an option has been picked, or a text file that gets changed on your server and keeps the number.

When the form is viewed, PHP would need to control if and when certain elements display by checking the database. Then, when a form is submitted, you would need to adjust the appropriate database entries. And I suppose there would need to be a time stamp of some sort, so that the database would reset if a new day started.

I don't think this could be done with Javascript -- it would need to be done with PHP or ASP.NET -- some dynamic programming language.

Re: How can I make decreasing options in form - radio buttons

falkencreative wrote:

So, basically, you want to cap the number of orders per day? Not per individual user, but for all users? So, for example, if the 2pm-3pm has been picked 4 times, the fifth user who tries to see the form won't see that option?

Yes this is what I need to do but I have to do it in asp because it will be on windows server. Does anyone know asp well?

Re: How can I make decreasing options in form - radio buttons

ASP, or ASP.NET? Also, just to be clear, PHP can run on a Windows server, it just depends how your server is set up. Either way though, the basic method I explained in my post will work either in PHP or ASP.

Re: How can I make decreasing options in form - radio buttons

falkencreative wrote:

ASP, or ASP.NET? Also, just to be clear, PHP can run on a Windows server, it just depends how your server is set up. Either way though, the basic method I explained in my post will work either in PHP or ASP.

Okay thanks falkencreative! You always give good info. I did look into my windows hosting and found that they do support php I am trying to find out how to enable it for lack of a better term. I will look into how to create a database like you suggested. I have a cart that is written in asp so want to try to use asp.

Last edited by mslfire (2009-01-03 14:52:21)