Richard Korts
asked on
Different Javascript on iPhone than Win 10 desktop?
I have this code in a program specifically designed (from a user interface perspective) to run on phone size devices.
When the specific form fields as indicated are filled in on the form on my iPhone (an iPhone 6), the test displays the alert, thus preventing submission of the form.
When I run the EXACT same program on a Windows 10 desktop, filling in the required fields, it works.
Does Javascript somehow differ on the iPhone from the desktop. Is it a Safari browser issue?
Thanks
if (document.st.pn.value == "" || document.st.padr.value == "" || document.st.cityf.value == "" || document.st.zip.value == "") {
alert("Minimum of property name, address, city & zip required.");
return false;
}
When the specific form fields as indicated are filled in on the form on my iPhone (an iPhone 6), the test displays the alert, thus preventing submission of the form.
When I run the EXACT same program on a Windows 10 desktop, filling in the required fields, it works.
Does Javascript somehow differ on the iPhone from the desktop. Is it a Safari browser issue?
Thanks
Is one of the fields a dropdown?
Different browsers have different engines, but they all work pretty much the same
Different browsers have different engines, but they all work pretty much the same
where do you call this function?
maybe you should just start using jQuery
maybe you should just start using jQuery
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or use
document.st.pn.value
>>>
document.forms["MyForm"].p n.value
or
document.forms[0].pn.value
if it is first or only form on page...
document.st.pn.value
>>>
document.forms["MyForm"].p
or
document.forms[0].pn.value
if it is first or only form on page...
ASKER
I will try your suggestions. The test link is not practical, a login is required, I would have to set one up for EE, communicate privately, etc.
I think document.forms[0].pn.value is the easiest to try.
The function this code is in a function called chk_vals & is invoked by the onSubmit event. I can show all the code but it's mixed in with php, etc.
Thanks
I think document.forms[0].pn.value
The function this code is in a function called chk_vals & is invoked by the onSubmit event. I can show all the code but it's mixed in with php, etc.
Thanks
ASKER
I did not try the other stuff. getElementById worked.
it should work...
do you have any test link?