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
Richard KortsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HainKurtSr. System AnalystCommented:
whats the exact issue?

I made a test here

https://jsfiddle.net/6e26ft6u/

change ac value to test different conditions...
0
Julian HansenCommented:
Under very specific circumstances, even when there are values in all of the four form fields, pn, paddr, city & zip, the alert occurs.
What circumstances?
If there are really values in all four of those variables there is no way the code will be executed - one of them must have a blank value.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard KortsAuthor Commented:
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.
0
Richard KortsAuthor Commented:
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!
0
Julian HansenCommented:
You are welcome Richard,
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.