Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JavaScript in Servlets

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I need help very urgently. The problem is I am having a link for product which displays the list of products retrieved from the db in a table. Each product record has a quantity text box and checkbox to select the product for buying. Now the problem is
1.how can I make sure that the user checks on product and enter quantity for another product. 2.Also I want to check the quantity is a number.
I want to do the validation in client side using Java script.
Any help on this would be really appreciated ASAP.
thanks
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to proceed in a step by step fashion, not jump in with both feet.
The first step would be to get a mockup HTML page created with example product data and using the necessary JavaScript to do the checking.
Next you can to create the same page from a servlet, faking the data that will eventually come from a database.
Only after you have all that running should you try to integrate the database.
Note that you could have practically all of the JavaScript in a separate file that you import into the generated page.
Bill
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi dear
instead of hard coding into servlet, write in an external file & call that file within the HTML tag in servlet like

HTH
MB.
 
reply
    Bookmark Topic Watch Topic
  • New Topic