Have you actually checked the object you're getting back to see (a) what it
is, and (b) how to access and/or manipulate it? These are all JavaScript
questions, not Struts, at least as far as I can tell.

Dave

On Fri, Dec 3, 2010 at 12:05 PM, Anjib Mulepati <anji...@hotmail.com> wrote:

> I make following change to test but still same problem
>
>
> function fnClickAddEmail() {
>    var email = $("input#email").val();
>    $.post(
>        "validateEmail.do",
>        {sendValue: email},
>        function(returnValue){
>           if(returnValue == "-1"){  //Changed here
>                displayError(email);
>            }else{
>                addToTable(returnValue);
>            }
>        },
>        "text"
>    );
> }
>
> And
>
>
> <% if(request.getAttribute("validEmail").equals("true")){ %>
> <%= request.getAttribute("emailAddress") %>
> <% }else{ %>
> <%= -1 %> // Changed here
> <%} %>
>
>
>
> Anjib
>
>
>
>
> On 12/3/2010 11:36 AM, Biesbrock, Kevin wrote:
>
>> Gosh, you're so close.
>>
>> If you change this method:
>> function fnClickAddEmail() {
>>      var email = $("input#email").val();
>>      $.post(
>>          "validateEmail.do",
>>          {sendValue: email},
>>          function(returnValue){   //Does this function called even my
>> email is invalid? Am I getting email.jsp page in "returnValue"?
>>              addToTable(returnValue);
>>          },
>>          "text"
>>      );
>> }
>>
>> To this:
>> function fnClickAddEmail() {
>>      var email = $("input#email").val();
>>      $.post(
>>          "validateEmail.do",
>>          {sendValue: email},
>>          function(returnValue){
>>                if (returnValue == "") {
>>                        // Show Error Message
>>                } else {
>>                        addToTable(returnValue);
>>                }
>>          },
>>          "text"
>>      );
>> }
>>
>> This should get your implementation working for you.  You're still not
>> utilizing JSON, but with the modified method it should work for you.
>>
>>
>> Beez
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to