This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calculating the number of tickets available

 
Saulo Menezes
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hya!
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.
Yours,
Saulo
PS.: All my pages are in JSP.

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you get your answer at the CodingForums or should I try to answer it for you?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic