Javascript Onchange event does not work on the Smartphone browser

Asked

Viewed 48 times

0

I created a call in a checkbox for a JS function and the desktop is working perfectly, already in the smartphone browser just doesn’t work. I have other functions that are called the same way in format text inputs on the same screen and have no problems. Already this call in the smartphone checkbox gave dick. Someone has been through a similar problems?

This is the div where I call the function:

<div ><!--class="checkbox">-->
<label><input type="checkbox" id="itemCheck" name="itemCheck" class="flat" onchange="verificafleg()"> Unable to calibrate</label>
</div>

and that’s the function in the JS file:

function verificafleg(){
    controle = window.document.getElementById("comment").value;
    if (controle == ""){
        document.getElementById('comment').value = "Unable to calibrate.";
        document.getElementById('comment').setAttribute("readonly", "readonly");
    } else if (controle = "Unable to calibrate.") {
        document.getElementById('comment').value = "";
        document.getElementById('comment').removeAttribute("readonly", "readonly");
    }
    
    
}

If someone has a light I’m accepting....

  • You don’t need to put "solved" in the title. I know it’s common in many forums, but here it works different. You have already marked a reply as accepted (when you clicked ) and this is enough to indicate that it has been solved.

1 answer

0


People found out what it was. I needed to enable the SSL certificate of the site where I was staying. Even with browser javascript enabled the site does not have SSL the browser did not correctly interpret the javascript of the field mentioned above. Just enable SSL and problem solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.