Loading ...
Sorry, an error occurred while loading the content.

Java script problem in Firefox. - More info

Expand Messages
  • Anand Subramanian
    Hi All, Some more info on the issue: The Validation scripts are something like this function validateFields() { // validates that the year combo box
    Message 1 of 4 , Oct 11, 2007
    • 0 Attachment
      Hi All,

      Some more info on the issue:

      The Validation scripts are something like this
      <script>
      function validateFields()
      {
      // validates that the year combo box is not empty
      if (form1.year.value == "")
      {
      alert("Please select the Year");
      form1.year.focus();
      event.returnValue=false;
      }
      //Validates that the price text box is not empty
      else if (form1.price.value == "")
      {
      alert("Please enter the Price");
      form1.price.focus();
      event.returnValue=false;
      }
      }
      </script>

      These work fine in IE. The messgae comes up and control stays in teh same page
      Whereas in Firefox, it gives the message, "Please select the Year" but continues to execute to the next page and hence throwing lot of errors.

      Thanks

      Anand


      ____________________________________________________________________________________
      Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
      http://tv.yahoo.com/


      [Non-text portions of this message have been removed]
    • bhavna patel
      Hi anand, It might be because of in IE and Firefox events are treated differently,, so when you return usinf event.returnValue it might not supported bye
      Message 2 of 4 , Oct 12, 2007
      • 0 Attachment
        Hi anand,

        It might be because of in IE and Firefox events are treated differently,, so when you return usinf
        event.returnValue it might not supported bye Firefox
        istead of that i suggess use only return false; (dont use event.returnValue) that will work in both IE as well as Firefox.

        Regards,
        Bhavna.



        ----- Original Message ----
        From: Anand Subramanian <axsubram@...>
        To: bang-phpug@yahoogroups.com
        Sent: Friday, October 12, 2007 6:35:39 AM
        Subject: [bang-phpug] Java script problem in Firefox. - More info

        Hi All,

        Some more info on the issue:

        The Validation scripts are something like this
        <script>
        function validateFields( )
        {
        // validates that the year combo box is not empty
        if (form1.year. value == "")
        {
        alert("Please select the Year");
        form1.year.focus( );
        event.returnValue= false;
        }
        //Validates that the price text box is not empty
        else if (form1.price. value == "")
        {
        alert("Please enter the Price");
        form1.price. focus();
        event.returnValue= false;
        }
        }
        </script>

        These work fine in IE. The messgae comes up and control stays in teh same page
        Whereas in Firefox, it gives the message, "Please select the Year" but continues to execute to the next page and hence throwing lot of errors.

        Thanks

        Anand

        ____________ _________ _________ _________ _________ _________ _
        Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
        http://tv.yahoo com/

        [Non-text portions of this message have been removed]






        ____________________________________________________________________________________
        Yahoo! oneSearch: Finally, mobile search
        that gives answers, not web links.
        http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

        [Non-text portions of this message have been removed]
      • Anand Subramanian
        Hi Bhavna, You are correct. This is what we have done and the problem is solved now. This seems to be the way to get it work in Firefox.. Now we are getting
        Message 3 of 4 , Oct 12, 2007
        • 0 Attachment
          Hi Bhavna,

          You are correct. This is what we have done and the problem is solved now.
          This seems to be the way to get it work in Firefox..

          Now we are getting an issue in displaying an image - after the user uploads a photo.

          The code we are using is
          document.forms["Image"].elements["H" + str].src = document.forms["Image"].elements[str].value; //.tostring;

          Once the user browses a photo, we want to show it. It works fine in IE , but in firefox, nothing happens.

          Any ideas ?

          Thanks a lot

          Anand


          ----- Original Message ----
          From: bhavna patel <bhavna_coolinus@...>
          To: bang-phpug@yahoogroups.com
          Sent: Friday, October 12, 2007 1:17:28 PM
          Subject: Re: [bang-phpug] Java script problem in Firefox. - More info

          Hi anand,

          It might be because of in IE and Firefox events are treated differently, , so when you return usinf
          event.returnValue it might not supported bye Firefox
          istead of that i suggess use only return false; (dont use event.returnValue) that will work in both IE as well as Firefox.

          Regards,
          Bhavna.

          ----- Original Message ----
          From: Anand Subramanian <axsubram@yahoo. com>
          To: bang-phpug@yahoogro ups.com
          Sent: Friday, October 12, 2007 6:35:39 AM
          Subject: [bang-phpug] Java script problem in Firefox. - More info

          Hi All,

          Some more info on the issue:

          The Validation scripts are something like this
          <script>
          function validateFields( )
          {
          // validates that the year combo box is not empty
          if (form1.year. value == "")
          {
          alert("Please select the Year");
          form1.year.focus( );
          event.returnValue= false;
          }
          //Validates that the price text box is not empty
          else if (form1.price. value == "")
          {
          alert("Please enter the Price");
          form1.price. focus();
          event.returnValue= false;
          }
          }
          </script>

          These work fine in IE. The messgae comes up and control stays in teh same page
          Whereas in Firefox, it gives the message, "Please select the Year" but continues to execute to the next page and hence throwing lot of errors.

          Thanks

          Anand

          ____________ _________ _________ _________ _________ _________ _
          Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
          http://tv.yahoo. com/

          [Non-text portions of this message have been removed]

          ____________ _________ _________ _________ _________ _________ _
          Yahoo! oneSearch: Finally, mobile search
          that gives answers, not web links.
          http://mobile. yahoo.com/ mobileweb/ onesearch? refer=1ONXIC

          [Non-text portions of this message have been removed]






          ____________________________________________________________________________________
          Need a vacation? Get great deals
          to amazing places on Yahoo! Travel.
          http://travel.yahoo.com/

          [Non-text portions of this message have been removed]
        • Amit Rana
          Anand, If your image tag has a name try this, will work on both IE and FF document[imagename].src=value see it in action here www.techjini.org regards, Amit.
          Message 4 of 4 , Oct 14, 2007
          • 0 Attachment
            Anand,
            If your image tag has a name try this, will work on
            both IE and FF
            document[imagename].src=value

            see it in action here www.techjini.org

            regards,
            Amit.



            ____________________________________________________________________________________
            Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
            http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
          Your message has been successfully submitted and would be delivered to recipients shortly.