i dont think ull run into problems atleast as long as u reatain the theme as
ajax.

try using theme as simple and give onblur="validate(this);". Also include
the necessary .js files (make the necessary ajax configurations and view
source in browser, ull see the .js files). check if the .js files are being
served to the browser. (fire bug of mozilla would help u)

basically a new node <td> is created and error is written into it (addError
of validate.js)

function addError(e, errorText) {
    try {
        // clear out any rows with an "errorFor" of e.id
        var row = e.parentNode.parentNode;
        var table = row.parentNode;
        var error = document.createTextNode(errorText);
...

so this approach should resolve ur issues.

regards,
ravi 




Mei Wei wrote:
> 
> Thank you!! This is a really detailed document. I finally got this
> problem solved.
> But now I noticed that the javascript creates html nodes to display
> error message dynamically. If I changed the layout then it does not work
> well.
> For example, if I have 4 columns in the table to display two fields.
> Do you or anyone have any experience about this?
> 
> Thanks,
> Mei
> 
> -----Original Message-----
> From: ravi_eze [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 22, 2008 9:04 PM
> To: user@struts.apache.org
> Subject: RE: how to validate field right after the data is entered,
> HELP!
> 
> 
> hi,
> 
> i solved the same problem this
> way:http://java-x.blogspot.com/2006/11/struts-2-validation.html Its ajax
> based validation. 
> 
> hope it helps.
> 
> cheers,
> ravi 
> 
> 
> 
> Mei Wei wrote:
>> 
>> Thanks, I looked at this document. I think it is more referring to 2.1
>> which does not have a stable release yet.
>> We prefer to use 2.0.11 since it is the latest stable release.
>> 
>> I was thinking about something like in the showcase example
> (quiz-ajax).
>> That we need to write a javascript function to listen to onblur()
> event
>> on the input text field. But I am not sure how to ask struts to
> validate
>> for this particular field, and how to get the error message back from
>> the response.
>> Can anyone help me on this?
>> 
>> Thanks,
>> Mei
>> 
>> -----Original Message-----
>> From: Martin Gainty [mailto:[EMAIL PROTECTED] 
>> Sent: Tuesday, January 22, 2008 4:54 PM
>> To: Struts Users Mailing List
>> Subject: Re: how to validate field right after the data is entered
>> 
>> take a look at
>> 
>> http://struts.apache.org/2.x/docs/dojo-submit.html
>> for attributes validate
>> and 
>> ajaxValidation
>> 
>> M
>> ----- Original Message ----- 
>> From: "Wei, Mei" <[EMAIL PROTECTED]>
>> To: "Struts Users Mailing List" <user@struts.apache.org>
>> Sent: Tuesday, January 22, 2008 7:15 PM
>> Subject: how to validate field right after the data is entered
>> 
>> 
>> Hi,
>> 
>>  
>> 
>> We want to validate the field data right after the data is entered. So
>> that the user can fix the error right away instead of waiting until
> the
>> whole form is submitted.
>> 
>> We thought that struts2 and ajax can help us on that. But what would
> be
>> the best way to do?
>> 
>>  
>> 
>> Any helps or guidance are appreciated.
>> 
>>  
>> 
>> Thanks,
>> 
>> Mei
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/how-to-validate-field-right-after-the-data-is-ente
> red-tp15032110p15035015.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-validate-field-right-after-the-data-is-entered-tp15032110p15037370.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to