I implement a function like "Billing address, similar to the function" Address ", which, when checked, fills the fields based on other fields. Works great.
Click event function.
if ($(this).attr('checked')) {
}
else{
}
Now I use the event (jQuery hotkey plugin) to automatically fill in all the fields in the form so that I can quickly and easily demo and validate the form. Instead of cheating and filling in billing fields as address fields I want to use
$("#CheckboxForAutofillId").trigger('click');
This does not work the first time I fire the event, because in the above function, which is called, it checks the checked attribute, however, the trigger ('click') seems to trigger the event BEFORE it changes the attribute.
, , .
$("#CheckboxForAutofillId").attr("checked", "checked"); // sets checked
$("#CheckboxForAutofillId").trigger('click'); // fires event then 'unchecks'
$("#CheckboxForAutofillId").attr("checked", "checked"); // rechecks
jquery , , , , , , "checked" ' , , ?
- ?