0. Displaying client-side inline error messages should be fairly easy. Instead of calling alert(message) write your own dhtml function such as inlineError(message) method for populating the same message into an object on the page. Note this wouldn't require server communication, so not AJAX.
1. Client side validation minimizes the response time and server load. That is, if you ensure that the client side validation is a useful subset (or equal set) of the server side validation. On the other hand, if your server behavior is well organized and can quickly return error strings without executing much logic, the user won't be penalized so much by a server round trip. 2. As for error resources - I don't know what the struts Validator offers, but our product solution is to generate a (locale-specific) javascript file from the properties file, so the same strings are available to the client. So ValidationMessages.properties valueTooBig=Value is too large is output as var valueTooBig = "Value is too large" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Benedict Sent: Tuesday, July 24, 2007 7:13 AM To: Struts Users Mailing List Subject: Re: Display inline error message I don't think #1 is a big deal. I don't use client side validation often. Yes, #2 is reinventing the wheel. There's nothing wrong with submitting to the server. On 7/24/07, semaj.najraham <[EMAIL PROTECTED]> wrote: > > > Hey Paul, > > Thanks for the reply. Displaying inline error messages is one of the user > requirements. I just want to get some thoughts... > > 1. As I need to display inline error messages, is it ok to use only server > side validation? I just don't want to use server side validation only. > Let's > say if the user doesn't type anything in the form and hits the submit > button, it has go through all server codes... This can be easily prevented > at client side... > 2. If I use my own javascript validation, will I be reinventing the wheel? > Even if I use it, is there a way to get the error messages from Message > Resources? For example: error messages in alert boxes. > > Regards, > semaj > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]