The previous answers to your question use JavaScript, which is ok.
If however you prefer to use pure Java, you can perform what you try
just by using JSP.

Let's imagine an HTML for with a text field where you want the user
to enter a number in the range 0..9.
<FORM>
  <INPUT TYPE=text NAME=anInt>
  <INPUT TYPE=submit VALUE="Submit!">
</FORM>

The first thing to do in your JSP is to verify the request implicit object.

if (request.getParameter("anInt") != null) ...

If the returned parameter String is null, you know that the page has been
loaded and no number has been entered.

If the returned parameter is not null, then you know that the page has
been loaded, something has been entered at the text field, and the
submit button has been pressed. Now you can make as many checks
as you need in the data.

If you need any further details do not hesitate to contact me.

Regards,

Rakesh Bhat ha escrito:

> Hi all,
>
> I want to do  the following task.Pls tell me how can i achieve it.
>
> 1)I have 3 input boxes.
> 2)I want the user to enter the value in all the input boxes.
> 3)If the user leaves a box unfilled , i want to indicate him  that the
> field cannot
> be left as it is after he submits.(I want the previous values that he
> filled in
> other input boxes to stay as it was.)
>
> I am writing this in JSP. Do I need to use java script to validate? What
> r the
> steps i need to follow ?
>
> Thx in advance
> Rakesh
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

--

--------------------------
"El bit es al hombre lo que el �tomo a Dios"
Enrique P�rez Soler
mailto:[EMAIL PROTECTED]
http://ttt.teleco.upv.es/~enpeso

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to