File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Custom Message / Warning box

 
Soumil Shah
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to create a custom message box to display warning / error message.

For instance, user wants to search particular customer's details, so he enters 'Last Name'.... but there some predefined criteria / validations .... like while searching, user has to enter both 'Last Name' AND 'First Name' / 'Last Name' AND 'DOB' etc.

So when user enters ONLY 'Last Name', i want to show error message box (not an alert box).

Please help me with this.
 
Nicola Garofalo
Ranch Hand
Posts: 308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example: put a div tag somewhere in your jsp



In the calling servlet set a request attribute when the error condition occurs:




 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want to do this on the client before the submission, or on the server after the submission.
 
Soumil Shah
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I am doing right now is.... Let's say on 'SearchCriteria.jsp" user enters only first name and clicks 'Submit' button... control goes to servlet, which validates the criteria, if failed sets the attribute and forwards it to 'error.jsp' where I am simply displaying it on the page using What I want is, instead of displaying on page, a warning / error box will be displayed with an error message.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then that is something you will have to build with JavaScript. You might want to look into jQuery UI which provides a handy dialog widget.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic