Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 89
  • Last Modified:

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
0
Richard Korts
Asked:
Richard Korts
  • 2
  • 2
1 Solution
 
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
 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now