Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Form plugin and hiding and showing stuff ?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26092
    Gabri
    Participant

    I have a form and this is the code i`m using to make it work

    Code:
    $(document).ready(function() {

    var options = {

    target: ‘#response’,

    clearForm: true,

    beforeSubmit: showRequest,

    success: showResponse

    };

    $(‘#contactForm’).ajaxForm(options);
    $(‘#response’).fadeIn(1500);
    return false;
    });

    function showRequest(formData, jqForm, options) {

    var queryString = $.param(formData);

    return true;

    }

    function showResponse(responseText, statusText) {

    }

    my problem is i want the reponse message to disappear after for ex. 2 sec how can i add this to the code i tried to add

    Code:
    $(‘#contactForm’).ajaxForm(options);
    $(‘#response’).fadeIn(1500);
    $(‘#response’).fadeOut(‘slow’);
    return false;
    });

    but it didn`t worked although there was no errors in Firebug ? so how can i achieve this ?

    #64006
    Rob MacKay
    Participant

    do you have a link to the live code? :D

    #64009
    Gabri
    Participant

    Unfortunately i can`t :(

    but it`s like this

    Code:

    when i click the submit button i want the <fieldset> to fadeout and the <ul> to fade in with the thanks you message , then after X seconds they both revert to there normal state Fieldset visible and ul display none.

    Now what is happening that when i click the submit button the ul appears with the thanks you message and still there and the fieldset is always visible. all of this i want it to happened when a successful submit occurs not on an empty fields for example .

    #64132

    Well, you can try this out

    Code:
    $(‘#response-message”).animate({opacity: 1.0}, 2000).fadeOut(500,function(){
    /* What ever you want to perform after it disappears */
    });

    You can do this just after where ever you are displaying your response message.. try it out and let me know ;)

    #64158
    Gabri
    Participant

    thanks but it didn`t work

    #64182

    it still didn’t work? That’s weird.. I used the above code for a client to display a landing page which disappears after 3 seconds and then the main site appears.. May be you can paste the javascript part of the code where you are using it?

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.