• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JSP Custom Message / Warning box

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:




 
Sheriff
Posts: 67618
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67618
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic