Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / October 2004

Tip: Looking for answers? Try searching our database.

How to validate the input field values before leaving the JSP page?

Thread view: 
Arnold Peters - 13 Oct 2004 22:07 GMT
I set up a jsp page (say: first.jsp) with a couple of input-/entryfields in a form.
After the user entered some values he clicks on the submit button.
Normally (if all values are acceptable) the user should be forwarded to the next page (next.jsp).
If (and only then) the values are wrong the user should stay on the current page and some
error messages should appear at the top of current jsp.

Thus what I need is a code execution BEFORE leaving the current page and not (only) when the
page is created.

How do I implement this with JavaServerPages (under JBoss) ?
Unfortuantely there is no command like

<form action="if (validate(this.formdata)==true) next.jsp else first.jsp">

Arnold
Tomer Ben-David - 27 Oct 2004 08:04 GMT
> I set up a jsp page (say: first.jsp) with a couple of input-/entryfields in a form.
> After the user entered some values he clicks on the submit button.
[quoted text clipped - 11 lines]
>
> Arnold

perhaps something like this

<form onSubmit="return somevalidation(this)"


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.