File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Calculating the number of tickets available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Calculating the number of tickets available" Watch "Calculating the number of tickets available" New topic

Calculating the number of tickets available

Saulo Menezes

Joined: Jan 15, 2003
Posts: 17
The code underneath is giving me lots of problems but I can't figure out what might be wrong, as I am very new to JavaScript. I would be grateful if somebody could give me a hint on what I should do to fix it.
Let me explain what this code is supposed to do briefly. I have a music venue that has a maximum number of tickets set to 100. On my page I want to show the number of tickets available on a text box or any other way that would let this change dynamically. This number would change based on which option the user would select on the drop-down list but would start as 100.
I would like that the number of tickets available were then sent to my server together with the other information given in the form.
Up to now the number of tickets selected by the user is sent and also the name of the band but not the number of tickets available.
I would also like to block the okay button if there are no tickets available. That's why I've added an alert to the code but I don't think it's a good solution.
Alternatively the number of tickets available could be linked to a database, but I would say that's too advanced for me at the moment.
I am looking forward to hearing from you.
PS.: All my pages are in JSP.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
did you get your answer at the CodingForums or should I try to answer it for you?
It is sorta covered in the JavaRanch Style Guide.
subject: Calculating the number of tickets available
It's not a secret anymore!