jagatuba
  • jagatuba
I have a JavaScript routine that works fine on IE and Chrome, but is acting wonky on Firefox. Thought someone might have an Idea what is wrong.
Computer Science
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

jagatuba
  • jagatuba
i have a form and I've written a function to validate the info entered on the form. Everything works fine except in Firefox. The symptoms are after the validations runs through an alert comes up listing the errors on the form. Once the alert is closed the user should be able to re-edit the form. Instead, they are shot over to the acknowledgement page. Here is the area where the program is running afoul:
jagatuba
  • jagatuba
if (cookie == true) { document.location.replace ('Kudler Fine Foods - Internet - Denied.html'); return false; } // End if there is a cookie else { if (doc.email.value != "" && message2 != "\nIf you intend to submit both your e-mail and your mailing " + "address, please be sure to fill in the entire mailing address " + "portion.\nPlease complete or clear the following fields:\n\n") { alert (message2); doc.elements(focal).focus(); return false; } // End check for both addresses else { // THE CONDITION BELOW IS THE ONE THAT SCREWS UP IN FIREFOX. THE TWO CONDITIONS ABOVE WORK AS THEY SHOULD IN ALL BROWSERS alert (message); doc.elements(focal).focus(); return false; } // End else for message } // End else give error
jagatuba
  • jagatuba
Update: I stepped through the function with Firebug and when it gets to that last condition it executes alert, it executes focus, but it does not execute return.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
Ok, that's the weirdest thing I've ever heard. What about the return statement in the previous block? Does it execute correctly?
jagatuba
  • jagatuba
Actually, at first I thought that it did, but upon checking again, I see that it doesn't. And I know. It is very strange and it only happens in Firefox.
jagatuba
  • jagatuba
Update: So I eliminated the message and focus statements in both of those clauses to see what would happen and guess what? The returns execute. So then I replaced the message statements and left the focus out. The returns still executed. So it has something to do with the focus statements. I'm not sure why Firefox does not like the focus statements. I'm going to look in to this right now.
jagatuba
  • jagatuba
Update: Hehehe. uh fixed the problem. I changed the lines from: doc.elements(focal).focus(); to: document.getElementById(focal).focus(); This works in all browsers.

Looking for something else?

Not the answer you are looking for? Search for more explanations.