Browser incompatibility with Form Fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PaulT
    New Member
    • Aug 2007
    • 7

    Browser incompatibility with Form Fields

    Hi there,

    My name's Paul and i'm an experienced non-HTML/PHP developer, just getting to grips with HTML & PHP.

    I have a simple form which is working fine in Mozilla, but not in IE5.

    The problem is that when the form is presented to the user, they cannot type anything into the input fields in IE5 but they can when using Mozilla.

    Here is a sample of the code:

    Code:
    echo "<form action='processform.php' method='post'>";
    		echo "<h1 class='d'>";
    		echo "<table border='0' cellspacing='0' cellpadding='0'>";
    		echo "<tr><td align='right'><B>First Name:</td>";
    		echo "<td><input type='text' name='firstname' value='$firstname' size='30' maxlength='30'></td>";	 
    		echo "</tr>";
    		echo "<tr><td align='right'><B>Surname:</td>";
    		echo "<td><input type='text' name='surname' value='$surname' size='30' maxlength='30'></td>";	 
    		echo "</tr>";
    </table>
    </form>
    The h1.d is defined as:
    Code:
    h1.d {position:absolute; left:450px; top:0px; font-family:georgia; font-size:6pt}
    As it's working fine in Mozilla, I know the basic idea is sound, but I have no idea why IE5 is not allowing data to be entered into the input fields.

    Many thanks if you decide to reply to me!

    Cheers
    Paul
  • kestrel
    Recognized Expert Top Contributor
    • Jul 2006
    • 1071

    #2
    Hey Paul, Welcome To the Scripts
    Im going to move this thread to the PHP forum, you will find all the help you need there.

    --
    Kestrel

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #3
      Thread title changed to describe the problem in a well manner.
      Ealiar : Hello & help please!

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        [CODE=php]
        echo "<form action='process form.php' method='post'>" ;
        echo "<h1 class='d'>";
        echo "<table border='0' cellspacing='0' cellpadding='0' >";
        echo "<tr><td align='right'>< B>First Name:</td>";
        echo "<td><input type='text' name='firstname ' value='$firstna me' size='30' maxlength='30'> </td>";
        echo "</tr>";
        echo "<tr><td align='right'>< B>Surname:</td>";
        echo "<td><input type='text' name='surname' value='$surname ' size='30' maxlength='30'> </td>";
        echo "</tr>";
        </table>
        </form>
        [/CODE]

        If you are trying to print this form and table dynamically, why dont you not echoing </table> and </form> elements.

        apart from that I couldn't figure out any problem with the form. And tested with IE7 and FF2.x.x (Sorry I dont have IE5)
        [CODE=php]echo '</table>';
        echo '</form>' ;[/CODE]

        and Give it a try, If failed post back.
        Thanks and regards,
        -ajaxrand

        Comment

        • PaulT
          New Member
          • Aug 2007
          • 7

          #5
          Hi,

          Thanks for taking a look at my code.

          I have made the change but with no success. Here is the entire program:

          Code:
          <?php /* Created on: 03/08/2007 */ 
          /* Receive Variables from HTML Form */		
          ?>
          <html>
          <style type="text/css">												
          h1.c {position:absolute; left:10px; top:75px; font-family:georgia; text-align: left; color: black; font-size: 12pt}
          </style>
          </head>
          <body bgcolor="lightgoldenrodyellow">
             		<TABLE width=100%; align=center; border="2" cellpadding="5">
          		<tr>
          		<td BGCOLOR='#00ff00'; align=center><b><font face=georgia size=5>Birmingham Self-Catering Business Accommodation</td>
          		</tr>
          		</table>
          	<h1 class="c">
          	<TABLE clear=both; float=left; border="1" cellpadding="1">
          	<TD><B>2348 Coventry Road, Sheldon, Birmingham,B26 3LS.<p>info@birminghamstay.co.uk<p>
          	Phone/fax 0044(0)121 742 1626<br>Phone 0044(0)121 688 1720<br>Mobile 079739312917<p>		
          	Please <A href='index.html' title='Home'>click here</A> to return to the Home Page.<br></td></table></h1>
          <?php	
          /* Receive Variables from HTML Form */
          		$err = $_REQUEST['err'];
          		$firstname = $_REQUEST['firstname'];
          		$surname = $_REQUEST['surname'];
          		$email = $_REQUEST['email'];
          		$phone = $_REQUEST['phone'];
          		$address1 = $_REQUEST['address1'];
          		$address2 = $_REQUEST['address2'];
          		$address3 = $_REQUEST['address3'];
          		$postcode = $_REQUEST['postcode'];
          		$message = $_REQUEST['message'];			
          /* Display HTML Form */
          		echo "<form action='processform.php' method='post'>";
          		echo "<h1 class='d'>";
          		echo "<table border='0' cellspacing='0' cellpadding='0'>";
          		echo "<tr><td align='right'><B>First Name:</td>";
          		echo "<td><input type='text' name='firstname' value='$firstname' size='30' maxlength='30'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'><B>Surname:</td>";
          		echo "<td><input type='text' name='surname' value='$surname' size='30' maxlength='30'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'><B>Email:</td>";
          		echo "<td><input type='text' name='email' value='$email' size='50' maxlength='50'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'><B>Telephone:</td>";
          		echo "<td><input type='text' name='phone' value='$phone' size='20' maxlength='20'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'><B>Address:</td>";
          		echo "<td><input type='text' name='address1' value='$address1' size='40' maxlength='40'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'></td>";
          		echo "<td><input type='text' name='address2' value='$address2' size='40' maxlength='40'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'></td>";
          		echo "<td><input type='text' name='address3' value='$address3' size='40' maxlength='40'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'><B>Postcode:</td>";
          		echo "<td><input type='text' name='postcode' value='$postcode' size='10' maxlength='10'></td>";	 
          		echo "</tr>";
          		echo "<tr><td align='right'><B>Message:</td>";
          		echo "<td><TEXTAREA NAME='message' value='$message' ROWS=10 COLS=30></TEXTAREA></td>";
          		echo "</tr>";
          		if ($err=="Y")
          			{
          			echo "<tr>";
          			echo "<b><font face=georgia color=red size=3>Please make sure you enter your Name & Email - thank you.";
          			echo "</tr>";
          			}
          		echo "</table>";
          		echo "<p><input type='submit' value='Send Message'>";
          		echo "</form>";
          ?>		   	
          </body>
          </html>

          Comment

          • ak1dnar
            Recognized Expert Top Contributor
            • Jan 2007
            • 1584

            #6
            The Problem is with your CSS.
            <h1> area is working as layer and it has overlap with the form elements.
            Try this Coding. I just changed the <h1> Position.

            [code=php]
            <?php /* Created on: 03/08/2007 */
            /* Receive Variables from HTML Form */
            ?>
            <html>
            <style type="text/css">
            h1.c {position:absol ute; left:560px; top:75px; font-family:georgia; text-align: left; color: black; font-size: 12pt}
            </style>
            </head>
            <body bgcolor="lightg oldenrodyellow" >
            <TABLE width=100%; align=center; border="2" cellpadding="5" >
            <tr>
            <td BGCOLOR='#00ff0 0'; align=center><b ><font face=georgia size=5>Birmingh am Self-Catering Business Accommodation</td>
            </tr>
            </table>
            <h1 class="c">
            <TABLE clear=both; float=left; border="1" cellpadding="1" >
            <TD><B>2348 Coventry Road, Sheldon, Birmingham,B26 3LS.<p>info@bir minghamstay.co. uk<p>
            Phone/fax 0044(0)121 742 1626<br>Phone 0044(0)121 688 1720<br>Mobile 079739312917<p>
            Please <A href='index.htm l' title='Home'>cl ick here</A> to return to the Home Page.<br></td></table></h1>
            <?php
            /* Receive Variables from HTML Form */
            $err = $_REQUEST['err'];
            $firstname = $_REQUEST['firstname'];
            $surname = $_REQUEST['surname'];
            $email = $_REQUEST['email'];
            $phone = $_REQUEST['phone'];
            $address1 = $_REQUEST['address1'];
            $address2 = $_REQUEST['address2'];
            $address3 = $_REQUEST['address3'];
            $postcode = $_REQUEST['postcode'];
            $message = $_REQUEST['message'];
            /* Display HTML Form */
            echo "<form action='process form.php' method='post'>" ;
            //echo "<h1 class='d'>";
            echo "<table border='0' cellspacing='0' cellpadding='0' >";
            echo "<tr><td align='right'>< B>First Name:</td>";
            echo "<td><input type='text' name='firstname ' value='$firstna me' size='30' maxlength='30'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'>< B>Surname:</td>";
            echo "<td><input type='text' name='surname' value='$surname ' size='30' maxlength='30'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'>< B>Email:</td>";
            echo "<td><input type='text' name='email' value='$email' size='50' maxlength='50'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'>< B>Telephone:</td>";
            echo "<td><input type='text' name='phone' value='$phone' size='20' maxlength='20'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'>< B>Address:</td>";
            echo "<td><input type='text' name='address1' value='$address 1' size='40' maxlength='40'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'></td>";
            echo "<td><input type='text' name='address2' value='$address 2' size='40' maxlength='40'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'></td>";
            echo "<td><input type='text' name='address3' value='$address 3' size='40' maxlength='40'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'>< B>Postcode:</td>";
            echo "<td><input type='text' name='postcode' value='$postcod e' size='10' maxlength='10'> </td>";
            echo "</tr>";
            echo "<tr><td align='right'>< B>Message:</td>";
            echo "<td><TEXTA REA NAME='message' value='$message ' ROWS=10 COLS=30></TEXTAREA></td>";
            echo "</tr>";
            if ($err=="Y")
            {
            echo "<tr>";
            echo "<b><font face=georgia color=red size=3>Please make sure you enter your Name & Email - thank you.";
            echo "</tr>";
            }
            echo "</table>";
            echo "<p><input type='submit' value='Send Message'>";
            echo "</form>";
            ?>
            </body>
            </html>

            [/code]

            Comment

            • PaulT
              New Member
              • Aug 2007
              • 7

              #7
              Thanks for that!

              When I run the revised code, my table containing the form is now on the left-hand-side, overlapping the table which is on the left. How do I get to position the form table on the right-hand side without using the <h1>, or is there something else I need to do?

              Thanks in advance!

              Paul

              Comment

              • PaulT
                New Member
                • Aug 2007
                • 7

                #8
                Ok, i've stripped the PHP out and reduced the HTML to the bare minimum to test it.

                Here's the code:

                Code:
                <html>
                <body>
                <form action="processform.php" method="post">
                <input type="text" name="firstname" size="30" maxlength="30">
                </form>
                </body>
                </html>
                In Firefox this produces a single field that accepts characters entered into it. In IE5 it produces a single field that is input-inhibited - nothing can be typed into it.

                Could any of you kind soles run this code in both Firefox and IE5 and see if i'm going mad?

                I'm at a loss!

                Cheers
                Paul

                Comment

                • Atli
                  Recognized Expert Expert
                  • Nov 2006
                  • 5062

                  #9
                  Originally posted by PaulT
                  Ok, i've stripped the PHP out and reduced the HTML to the bare minimum to test it.

                  Here's the code:

                  Code:
                  <html>
                  <body>
                  <form action="processform.php" method="post">
                  <input type="text" name="firstname" size="30" maxlength="30">
                  </form>
                  </body>
                  </html>
                  In Firefox this produces a single field that accepts characters entered into it. In IE5 it produces a single field that is input-inhibited - nothing can be typed into it.

                  Could any of you kind soles run this code in both Firefox and IE5 and see if i'm going mad?

                  I'm at a loss!

                  Cheers
                  Paul
                  Sorry, dont have IE5 :(

                  But try closing the <input> tag, like so:
                  [code=html]
                  <input type='text' value='...' />
                  <!-- or -->
                  <input type='text' value='...'></input>
                  [/code]

                  You may also want to remove the size and maxlength properties and see what happens.

                  Comment

                  • PaulT
                    New Member
                    • Aug 2007
                    • 7

                    #10
                    Thanks Atli, though it still does the same thing.

                    The code now looks like:

                    Code:
                    <html>
                    <body>
                    <form action="processform.php" method="post">
                    <input type="text" name="firstname"></input>
                    </form>
                    </body>
                    </html>
                    Could someone try it in IE6 and see what it does?

                    Cheers
                    Paul

                    Comment

                    • drhowarddrfine
                      Recognized Expert Expert
                      • Sep 2006
                      • 7434

                      #11
                      Personally, I see no reason to support IE5. Unless you have a specific reason for it.

                      Comment

                      • PaulT
                        New Member
                        • Aug 2007
                        • 7

                        #12
                        Hi drhowarddrfine,

                        Thanks for your note. I don;t particularly want to support IE5, I just want it to be available on the majority of browser versions. I personally don't have IE6 or IE7 installed - could you (or anyone else for that matter) just take a minute to see if it works with these browsers?

                        Thanks!

                        Paul

                        Comment

                        • Atli
                          Recognized Expert Expert
                          • Nov 2006
                          • 5062

                          #13
                          Originally posted by PaulT
                          Hi drhowarddrfine,

                          Thanks for your note. I don;t particularly want to support IE5, I just want it to be available on the majority of browser versions. I personally don't have IE6 or IE7 installed - could you (or anyone else for that matter) just take a minute to see if it works with these browsers?

                          Thanks!

                          Paul
                          It works like it should on IE7.

                          Comment

                          • PaulT
                            New Member
                            • Aug 2007
                            • 7

                            #14
                            Thanks Atli, that's what I need to know!

                            Many thanks for everyone's help on this.

                            Regards
                            Paul

                            Comment

                            • ak1dnar
                              Recognized Expert Top Contributor
                              • Jan 2007
                              • 1584

                              #15
                              hi Paul,
                              If you think you didn't get the answer yet just let us know. then we will be able to move this to HTML/CSS forum.
                              Thanks and regards,
                              -ajaxrand

                              Comment

                              Working...