swapping via jquery? -
i have button want user click , turns spinner this thinking have this...
<form method="post" id="new_resource" class="new_resource" action="/resources"> <div class="field"> <input type="text" size="30" name="resource[url]" id="resource_url"> <input type="hidden" value="5" name="resource[course_id]" id="resource_course_id"> </div> <div class="actions"> <input type="submit" value="create" name="commit" id="resource_submit"> </div> </form>
so need if clicks on submit form button id="resource_submit display spinner...i thinking of putting spinner below input tag in span or image tag wasnt sure best way...
here jquery far
$('form').submit(function(e){ $(this).find('#resource_submit').hide(); e.preventdefault(); });
i have multiple forms on page thats why using approach dont know how implement spinner logic
i'm not sure you're missing here, aside hidden image of animated spinner.
css
.noshow{display:none;}
html
<img src="/images/spinner.gif" class="noshow" />
js
$('form').submit(function(e){ $(this).find('#resource_submit').hide(); $(this).find('#spinnerimage').show(); });
Comments
Post a Comment