I have a simple form that contains a lot of duplicate textboxes. I have a button called "Copy" that simply copies values from certain textboxes to another.
HTML:
<button id="copycorporate">Copy</button>
jQuery:
$('#copycorporate').button();
$('#copycorporate').click(function(e) {
e.preventDefault();
$('#txt_streetadd').val( $('#txt_cor开发者_Python百科p_address').val() );
$('#txt_suitefloor').val( $('#txt_corp_suite').val() );
})
Now depending on the browser, in this case Firefox 6.0, it prompts the user if they would like to save the form information (usually this happens after a submission). How do I avoid triggering the autocomplete feature when by users simply click on a non-submit utility button?
autocomplete="off"
in your input, probably
what about adding the attribute like this?
$('#txt_streetadd').val( $('#txt_corp_address').val() ).attr("autocomplete","off");
精彩评论