javascript - Replace text on page on form submit -


i have form let people submit news articles site (a company intranet). form submission takes few seconds resolve due actions have in place on relevant model save method. wanted replace text on form page message saying "sending article. may take few seconds, please not refresh page." hits submit. i've seen these on number of websites when buying things online.

my first attempt @ doing add onclick event form button. submitting replaced text did not submit form. had @ this answer on binding 2 events 1 submit button doesn't seem address need looks php-specific. i'm javascript right tool job can't think of how other binding clicking submit button. know correct way this?

javascript indeed right way so. if using jquery can go ahead , use like:

$('form#your-form-id').submit(function(){     $(this).hide().after('loading, please wait...'); }); 

where #your-form-id id of form. function hiding form content , showing text, instead actually.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -