• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP form problem

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,

i am developing a web application in which i accept bookings for a cinema. on the booking page i have a table with a drop down menu(0-10) for the number of tickets they want(ie. adults). the next column in the table is the SUBTOTAL field. i want it to automically set the subtotal price when the user selects a number from the drop down menu and display in right then. (e.g.) user selects 2 tickets...(2*7.00)=subtotal...14
does any1 know how i could do this?

thanks keith.
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not a JSP question but an HTML/Javascript one. JSPs offer no support for user-interaction, that is relient upon browser supported javascript (and keep in mind such features can be disabled on browsers).

Back to your question... you need to add javascript events on the form boxes (check out the 18.2.3 in http://www.w3.org/TR/html4/interact/scripts.html for list of events). The best way is to create a javascript function in the header of your html page and call this function on a common even on this form such as onchange event.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the HTML forum.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic