Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Javascript / Firefox / Java Issue

We have an add that has been working for months, maybe a year. Recently an issue has arisen.

See this code:
function chk_vals() {
			if (ac == "l") {
				jj = confirm("Log Out will lose all data entered. OK?");
				if (! jj) {
					return false;
				}
				document.st.action = "logout.php";
				return true;
			}	
			if (ac == "c") {
				jj = confirm("Cancel will lose all data entered. OK?");
				if (! jj) {
					return false;
				}	
				document.st.action = cancpg;
				return true;
			}	
			if (document.st.pn.value == "" || document.st.padr.value == "" || document.st.city.value == "" || document.st.zip.value == "") {
				alert("Minimum of property name, address, city & zip required.");
				return false;
			}

Open in new window


Under very specific circumstances, even when there are values in all of the four form fields, pn, paddr, city & zip, the alert occurs.

3 people have tested this, all using FireFox. The problem NEVER occurs for me. It always occurs for person B. For person C, they updated Java on thee computer (all Windows computers), they had been told that Java needed updating. When they did that, it now works.

Is Java used by FireFox in Windows 10 environment? NO Java is used in the web app (all Javascript, php, mySQL, html, Jquery).

Thanks
Avatar of HainKurt
HainKurt
Flag of Canada image

whats the exact issue?

I made a test here

https://jsfiddle.net/6e26ft6u/

change ac value to test different conditions...
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Korts

ASKER

Julian,

Based on your response, it occurs to me that I MIGHT have accidentally duplicated the form field name for one of those four elsewhere in the form or maybe in a hidden field; I will check that idea.
I had a hidden field called city on the form; in MOST cases, that field is set to the value of city (based on another criteria), but in this case it was not, it is set to null.

I have to test my fix but your response led me to the issue.

Thanks!
You are welcome Richard,