Form Field Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    Form Field Problem

    I have an Enquiry Form but when you log onto it for some reason I can't foucs on any of the first three input fields on the first radio buttons.
    The first field that can be focused on is the Enquiry field which is a text area.

    In IE the only way I can focus is to click the very start or very end of the fields which does not help users, and I can't get them to focus at all in Firefox, Safari, Opera or Google Chrome.

    I was able to set the foucs on the first field using Javascript that mean tabbing through the fields and if you click outside, you have to refresh to get the focus back. I've tried a javascript on click and still can't get it to work. I have an identical form on a different website that has no problems.

    Can anyone suggest what is going on?
  • mrjohn
    New Member
    • May 2009
    • 31

    #2
    Perhaps you could post the code for us?

    Comment

    • KeredDrahcir
      Contributor
      • Nov 2009
      • 426

      #3
      The code I'm using is here. I have got an submit button but I seem to have missed that out in the code.

      <form name="Enquiry_F orm" method="post" action="enquiry _form.php">
      <table style="text-align: left;">
      <tr>
      <td colspan="2">
      <h1>Please complete the following</h1>
      </td>
      </tr>
      <tr>
      <td width="30%">
      <?php check_filled($s ubmitted,'name' ); ?>
      Your Name:</font>
      </td>
      <td>
      <input type="text" name="name" size="40" value="<?php posted_value($s ubmitted,'name' );?>"/>
      </td>
      </tr>
      <tr>
      <td>
      <?php
      if (!strcmp($_POST['preferred'],"email"))
      { check_filled($s ubmitted,'email ');}
      ?>
      Your Email Address:</font>
      </td>
      <td>
      <input type="text" name="email" size="40" value="<?php posted_value($s ubmitted,'email '); ?>" onclick="docume nt.forms[0].elements[1].focus()"/>
      </td>
      </tr>
      <tr>
      <td>
      <?php
      if (!strcmp($_POST['preferred'],"phone"))
      { check_filled($s ubmitted,'phone ');}
      ?>
      Your Phone Number:</font>
      </td>
      <td>
      <input type="text" name="phone" size="40" value="<?php posted_value($s ubmitted,'phone ');?>"/>
      </td>
      </tr>
      <tr>
      <td>
      Preferred Method of Contact:
      </td>
      <td>
      <input type="radio" name="preferred " value="email"
      <?php if ($_POST['preferred'])
      { if (!strcmp($_POST['preferred'],"email"))
      { echo "checked";}
      } else {echo "checked";}
      ?>
      >
      Email
      <input type="radio" name="preferred " value="phone" <?php if (!strcmp($_POST['preferred'],phone)) {echo "checked";} ?>>
      Phone
      </td>
      </tr>
      <tr>
      <td colspan="2">
      <?php
      check_filled($s ubmitted,'enqui ry');
      ?><br/>
      Enquiry/Message:</font>
      </td>
      </tr>
      <tr>
      <td colspan="2" align="center">
      <textarea name="enquiry" cols="50" rows="5"><?php posted_value($s ubmitted,'enqui ry');?></textarea>
      </td>
      </tr>
      <tr>
      <td>
      <?php check_filled($s ubmitted,'sourc e'); ?>
      How did you hear about us:</font>
      </td>
      <td>
      <select name="source">
      <option><?php posted_value($s ubmitted,'sourc e'); ?></option>
      <option>Local Paper</option>
      <option>Persona l Recommendation</option>
      <option>Searc h Engine</option>
      <option>Yello w Pages</option>
      <option>Other </option></select>
      </td>
      </tr>
      <tr>
      <td>
      <?php
      if (!strcmp($_POST['source'],'Other')){
      check_filled($s ubmitted,$enqui ry_filled);}
      ?>
      If other,please specify:</font>
      </td>
      <td>
      <input type="text" name="other" size=40 value="<?php posted_value($s ubmitted,'other ');?>"></textarea>
      </td>
      </tr>
      <tr>
      <td colspan="2">
      <br/><p/>
      <input type="checkbox" name="mailing_l ist" value="Yes">Yes , please add me to your mailing list for future promotions.
      </td>
      </tr>
      </table>
      </form>

      Comment

      • KeredDrahcir
        Contributor
        • Nov 2009
        • 426

        #4
        Any suggestions anybody? I'm getting this problem across multiple websites and can't imagine how many enquiries I'm missing.

        Comment

        • KeredDrahcir
          Contributor
          • Nov 2009
          • 426

          #5
          Can anyone help? I'm really at a loss.

          Comment

          • KeredDrahcir
            Contributor
            • Nov 2009
            • 426

            #6
            I'm getting a similar problem. The first text box wont focus. The pointer stays as an arrow when I move the mouse over but the issue only occurs in Firefox. I've got no problems in IE or Safari.

            Could anyone please help me?
            Code:
            <tr>
              <td>Your Name: </td>
              <td><input type='text' name='name' maxlength='64' value='' /></td>
            </tr>

            Comment

            • Death Slaught
              Top Contributor
              • Aug 2007
              • 1137

              #7
              When posting code please make sure to use code tags - in the editor it is the number sign.

              Try giving this a shot and if you have any problems let me know.


              Thanks, Death

              Comment

              Working...