www.webdeveloper.com
Results 1 to 2 of 2

Thread: Ajax + Jquery +PHP !!!

Hybrid View

  1. #1
    Join Date
    Mar 2014
    Posts
    70

    Ajax + Jquery +PHP !!!

    <script type="text/javascript" language="javascript">

    $(document).ready(function(){
    $("#username").change(function() {

    var username= $("#username").val();
    var email = $("#email").val();
    var dataString = "username ="+ username + "&email =" + email;
    $.ajax({
    type: "POST",
    url: "check.php",
    data:dataString,
    success: function(msg){
    if( msg =="ok")
    {
    $("#username").addClass("UserAvailable");
    }
    else
    {
    $("#userError").html('The username should have at least 4 characters.</font>');
    }
    });
    });
    });
    </script>
    This is the code for validating only one input field.. i don't know how can i do for more than one input field
    because on success: function(msg) it retrieving what ever is echo on check.php....

  2. #2
    Join Date
    Mar 2014
    Posts
    70
    can any one tell me how to get the response for two fields from server using ajax!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles