Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

jagatuba Group Title

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.

  • 3 years ago
  • 3 years ago

  • This Question is Closed
  1. jagatuba Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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:

    • 3 years ago
  2. jagatuba Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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

    • 3 years ago
  3. jagatuba Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 3 years ago
  4. Lifeburner Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    Ok, that's the weirdest thing I've ever heard. What about the return statement in the previous block? Does it execute correctly?

    • 3 years ago
  5. jagatuba Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 3 years ago
  6. jagatuba Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 3 years ago
  7. jagatuba Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 3 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.