• 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
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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".
 
I want my playground back. Here, I'll give you this tiny ad for it:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic