jeudi 21 juillet 2016

"old" phones do not show the checkbox checkmark, when is checked via javascript

Good day all. I've a page with a form, there is a option (a checkbox) that MUST be checked in order to submit the form, so basically there is a simple javascript like this:

function checkbox_tick_action (){
$("#mt-container #option").prop( 'checked',true );
$("#mt-container #option").attr('checked','checked');
console.log("ticked");
}

binded on the submit event. This work pretty fine, but on some mobiles, the checkbox isn't updated, so this happen:

the form is submitted (the checkbox IS ticked, but shown as unticked). landing on the next page, and hitting the back button, the checkbox is now showed as ticked. I have done a number of test and I'm prett sure is a matter of "updating the DOM" or something that simply does not render the new "visual" of the checkbox.

anyone has a hint on how to solve this issue?

is there a way to force the render of an element, via js?

Note that this is actually working on most devices.

one of the devices that has this issue is Samsung ACE, using the stock browser.

all the phones that has this issue, are somehow dated.




Aucun commentaire:

Enregistrer un commentaire