I am using Gravity Forms and would like to change their submit button text to read "processing..." after onclick. Gravity Forms has told me to use some custom javascript in the heading.php file to make this happen. The following script was given (http://stackoverflow.com/questions/1071012/using-jquery-to-change-input-button-text-back-after-a-few-seconds) this link to point me the right direction but I am still learning and need some help! Can someone please break this code down for me a bit?
$("form.stock").submit(function()
{
var $form = $(this);
$.post( $form.attr('action'), { id: '123', stock: '1' } );
var $submit = $form.find(":submit").attr('value','Saved!');
window.setTimeout(function()
{
$submit.attr('value','Update')
}, 2000);
return false;
});
What is form.stock referring to? And- id: '123' stock: '1' referring to?
And lastly, what does (this) do? - var $form = $(this);
I would appreciate your kindness - I know these are some basic questions that I should know!