Reputation: 1799
I am trying to disable an input submit button.
the problem is,
$(this).atrr('refresh');
so once the button has been disabled it should refresh it so it visually appears to be disabledany advise would be much appreciated
html
<input class="submit button-primary btn large send submit_wide" id="wp-submit" name="up_submit" tabindex="250" type="submit" value="test" />
jquery mobile code
<script type="text/javascript">
$(document).ready(function () {
var clicked = false;
$('#wp-submit').click(function() {
if(clicked === false) {
$(this).attr('disabled','disabled');
// $(this).atrr('refresh');
clicked = true;
}
});
});
</script>
Upvotes: 0
Views: 70
Reputation: 827
Your solution works on JSFiddle :Fiddle. Maybe you can try the JQueryMobile function .button('disable') :
$(document).ready(function () {
var clicked = false;
$('#wp-submit').click(function() {
if(clicked === false) {
$(this).button('disable');
// $(this).attr('disabled','disabled');
clicked = true;
}
});
});
Looks like refresh is a normal thing to do (From JQueryMobile website):
If you manipulate a form button via JavaScript, you must call the refresh method on it to update the visual styling.
$('[type="submit"]').button('refresh');
Upvotes: 1