• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

checking user inputs

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how would i check the user's input in a servlets. for example, i have a five textbox, how would the program know if these textbox are all fill up before you hit the submit button. can i use javascript in servlets?

raymond
 
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by raymond yadao:
how would i check the user's input in a servlets. for example, i have a five textbox, how would the program know if these textbox are all fill up before you hit the submit button. can i use javascript in servlets?



Yeah obviously u need to validate the html form using javascript or using serverside validation.U can embed javascript in html which is being pumped out by servlet's PrintWriter or OutputStream.
Anil
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Call the getParameter() method on req and check whether the input is null or has a length of zero on all of the text boxes.
 
raymond yadao
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marilyn deQueiroz:
Call the getParameter() method on req and check whether the input is null or has a length of zero on all of the text boxes.


but this can only be done as soon as u click the submit button. what i want is that, from the client browser it will check now if all the text boxes are fill up. so if it find that one has been leave blanks it will alert the user that some text boxes has not been leave blank.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anything that is done on the client really sneeds to be done in JavaScript. Try asking this in the "HTML and JavaScript forum".
 
The City calls upon her steadfast protectors. Now for a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic