How to allow left click to enter info in text box form in FireFox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jerrydigital
    New Member
    • Oct 2008
    • 67

    How to allow left click to enter info in text box form in FireFox

    Hello,

    I had my webpage up and running great on both Internet Explorer and Firefox. The problem is, on FireFox the user can only right click the text box in forms to enter information. How do I change this so they can left click because I feel that is more natural.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    What you say should not be happening so there must be something else wrong. Without a link, or the complete markup, we can only guess.

    Comment

    • jerrydigital
      New Member
      • Oct 2008
      • 67

      #3
      Below is the code to my contact page. I orignially created my webpage with internet explorer and it worked great. when I converted to Firefox, I have noticed some things in the code changed and obviously something changed which doesn't allow me to left click on the text box. any ideas what that could be? Thanks for any thoughts.

      Code:
      <html><head>
      <title>Contact Us</title>
      <script language="JavaScript1.2">
      function disableselect(e){
      return false
      }
      function reEnable(){
      return true
      }
      document.onselectstart=new Function ("return false")
      if (window.sidebar){
      document.onmousedown=disableselect
      document.onclick=reEnable
      }
      </script>
      <script type="text/javascript">
      <!--
      function validate_form ( )
      {
      valid = true;
      if ( document.contactus.name.value == "")
      {
      alert ( "Please type in your Name." );
      document.contactus.name.focus();
      return false;
      }
      if ( document.contactus.email.value == "")
      {
      alert ( "Please enter an email address." );
      document.contactus.email.focus();
      return false;
      }
      var checkEmail = "@.";
              var checkStr = document.contactus.email.value;
              var EmailValid = false;
              var EmailAt = false;
              var EmailPeriod = false;
              for (i = 0;  i < checkStr.length;  i++)
              {
              ch = checkStr.charAt(i);
              for (j = 0;  j < checkEmail.length;  j++)
              {
              if (ch == checkEmail.charAt(j) && ch == "@")
              EmailAt = true;
              if (ch == checkEmail.charAt(j) && ch == ".")
              EmailPeriod = true;
                if (EmailAt && EmailPeriod)
                      break;
                if (j == checkEmail.length)
                      break;
              }
              // if both the @ and . were in the string
              if (EmailAt && EmailPeriod)
              {
                      EmailValid = true
                      break;
              }
              }
              if (!EmailValid)
              {
              alert("The \"email\" field must contain an \"@\" and a \".\".");
              document.contactus.email.focus();
              return (false);
              }
      if ( document.contactus.subber.value == "")
      {
      alert ( "Please type in a Subject." );
      document.contactus.subber.focus();
      return false;
      }
      return valid;
      }
      //-->
      </script>
      </head>
      <body>
      <form action="contactus.asp" method=post name="contactus" onsubmit="return validate_form ( );">
      <input type="hidden" name="subject" value="ContactUs Form Submission">
      <input type="hidden" name="redirect" value="thankyou.html">
      <pre>
      <b><center><font face="comics sans ms" size="+3">If you wish to contact us, please fill out the form below.</font> 
      <br><font face="comic sans ms"><b>Name:	      <input type="text" name="name" size="25">
      <br>Email Address: <input type="text" name="email" size="25">
      <br>Subject:	      <input type="text" name="subber" size="25">
      <br>Message:
      <textarea cols="50" rows="4" name="message"></textarea>
      <input type="submit" value="Submit"><input type="reset">
      </form>
      </body>
      </html>

      Comment

      • serdar
        New Member
        • Nov 2008
        • 88

        #4
        I didn't read the entire code but this is what disables the mouse click in Firefox. Remove the following lines from your code and test.

        Code:
        if (window.sidebar){
        document.onmousedown=disableselect
        document.onclick=reEnable
        }
        And these two functions are not needed in this case:
        Code:
        function disableselect(e){
        return false
        }
        function reEnable(){
        return true
        }

        Comment

        • jerrydigital
          New Member
          • Oct 2008
          • 67

          #5
          great, thank you very much. this works now.

          Comment

          Working...