Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

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
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.

Join Brainly to access

this expert answer

SEE EXPERT ANSWER

To see the expert answer you'll need to create a free account at Brainly

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:
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
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.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Ok, that's the weirdest thing I've ever heard. What about the return statement in the previous block? Does it execute correctly?
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.
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.
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.

Not the answer you are looking for?

Search for more explanations.

Ask your own question