I have up-to-date the question since it may due to gravity forms that is preventing an easy function from working. The main reason I only say the reason being I have attempted a lot of options (the following) to trigger a jQuery function, and not one of them work once they should.

I've got a simple function below which 100% works...

var $contactButton  = $(".contact-slide a"),
    $contactSlide   = $("#horizon-slide");

function () {
    $contactSlide.stop().css("top","0");
};

Simple because it will get, but I am attempting to trigger this when my submit button will get clicked on from the gravity from.


This is actually the wordpress gravity forms input markup...

<input type="submit" id="gform_submit_button_1" class="button gform_button" value="Send" tabindex="7"></input>


They are all of the scripts below that I have attempted, but not one of them run the function...

Script One

$("input#gform_submit_button_1").on('click', function () {
    $contactSlide.stop().css("top","0");
});

Script Two

$("input#gform_submit_button_1").click(function() {
    $contactSlide.stop().css("top","0");
});

Script Three

$("input#gform_submit_button_1").focus(function () {
    $contactSlide.stop().css("top","0");
});

Script Four

$("form#gform_1").submit(function(event) {
$contactSlide.stop().css("top","0");
});


I have also attempted...

return false; 

and

return true;

on all the scripts above, but not one of them return the function. Basically set the scripts to come back false then your form doesn't submit, but when I set to come back true, then form submits however the function doesn't run.


Why happening, I figured this is fundamental stuff?

Thank you for any help.

$contactInput.focus(function () {
    $contactSlide.stop().css("top","0");
    $('body,html').animate({
        scrollTop: 0
    }, 0);
    return true;
});

Try it out :)

You are able to manage it in the form submit for those who have an application..

<script type="text/javascript" src="js/jquery1.6.1.js"></script>
<script type="text/javascript">
 $(document).ready(function () {
   $("#forma").submit(function(event) {
       //do what ever you need to here
        return false;
    });
});
</script>
<form name="1stform" method="post" action="/">
    <input type="text" name="misc" id="misc" />
    <input type="submit" name="submit" id="submit" value="submit 1st form"/>
</form>