SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with Jquery and Ajax Post

    Hi All,

    I have a problem with Ajax Submit Can anyone please help??

    I am using a jquery window with sliding divs for three options new user signup, login and ignore

    When the user selects the login the following code has to be executed.

    Everything works fine. but after the submit i am not getting the response from Process.php back

    Can anyone help me
    Urgent help required!!!!!!!

    // This is my Javascript where i am calling the submit

    $(document).ready(function() {
    $('#frmsignin').submit( submitForm );
    }

    function submitForm() {
    var signinform = $('#dialog1');
    var signin = $(this);
    // Are all the fields filled in?
    if ( !(document.getElementById("email").value || !document.getElementById("pass").value )) {

    // No; display a warning message and return to the form
    $('#incompleteMessage').fadeIn().delay(messageDelay).fadeOut();
    signinform.fadeOut().delay(messageDelay).fadeIn();

    } else {

    // Yes; submit the form to the PHP script via Ajax
    var strPost = signin.serialize();

    $('#sendingMessage').fadeIn();
    signinform.fadeOut();
    $.ajax({
    url: "/Process.php",//signin.attr( 'action' ) ,//+ "?ajax=true",
    type: "POST",
    data: $strPost,
    success: submitFinished
    });
    }

    // Prevent the default form submission occurring
    return false;
    }
    // Handle the Ajax response

    function submitFinished( response ) {
    $response = $.trim( response );
    alert($response);
    $('#sendingMessage').fadeOut();

    if ( $response == "success" ) {

    // Form submitted successfully:
    // 1. Display the success message
    // 2. Clear the form fields
    // 3. Fade the content back in

    $('#successMessage').fadeIn().delay(messageDelay).fadeOut();
    $('#email').val( "" );
    $('#pass').val( "" );
    $('#content').delay(messageDelay+500).fadeTo( 'slow', 1 );

    } else {

    // Form submission failed: Display the failure message,
    // then redisplay the form
    $('#failureMessage').fadeIn().delay(messageDelay).fadeOut();
    $('#dialog1').delay(messageDelay+500).fadeIn();
    }
    }
    });

    Thanks and Regards

  2. #2
    Non-Member
    Join Date
    Apr 2011
    Location
    no fixed address
    Posts
    851
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rajju14 View Post
    Urgent help required!!!!!!!
    When is your dead line? No point me in me posting a suggestion if the dead line has passed.

    And if it genuinely is urgent, I suppose you have probably posted this request on multiple websites and it's possible you might already have the solution.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No sir, I am really trying for this from the past 3 days
    Please help me
    No deadline!!!!!

  4. #4
    Non-Member
    Join Date
    Apr 2011
    Location
    no fixed address
    Posts
    851
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rajju14 View Post
    No sir, I am really trying for this from the past 3 days
    Please help me
    No deadline!!!!!
    Then why say it's urgent?


Bookmarks

Posting Permissions

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