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