• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaScript in Servlets  RSS feed

 
Need Help
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!