tags:

views:

419

answers:

6

this form code is working in Mozilla , chrome but in internet explorer it is not working.

      <form method="post" action="logincheck.php" >
      <span class="meta">
      <table>   
   </span>
<tr><td> <span class="meta">
 <label >Username </label>
</span>
  <label ></td>
<td> <input name="username" type="text" /></label></form>
 </td></tr>
<tr><td> <label ><span class="meta">Password</td><td>
  <input name="password" type="password" />
</span></label></td></tr>
<tr><td> <span class="meta">

</span>
  <label >    
  <input type="submit" name="Submit" value="Submit"  class="submit"/>
                    </label></td></tr>
</table>   
  </form>
A: 

<span class="meta"> <table>
</span>

The nesting is wrong. In fact, there's a lot more wrong. Try googling what <label> does exactly, and what <span> does and when you want to use it. You probably want something like this:

<form method="post" action="logincheck.php" >
  <table>   
    <tr>
      <td><label class="meta">Username </label></td>
      <td><input name="username" type="text" /></td>
     </tr>
     <tr>
      <td><label class="meta">Password</td>
      <td><input name="password" type="password" /></td>
    </tr>
    <tr>
      <td colspan="2"><input type="submit" name="Submit" value="Submit"  class="submit"></td>
    </tr>
  </table>   
</form>
Sietse
i have corrected this
nicky
Well? Did it help?
Sietse
+3  A: 

You have errors that automated QA tools can detect

David Dorward
A: 

One first error is:

<span class="meta">
<table>   
</span>

But you have many errors.

Open and close tags as you will do with parenthesis. No horse riding. HTML and now XHTML need you to be a little bit more conscientious.

usefull tool:

enguerran
have corected this.
nicky
A: 

Here is a version without span tags, label and extra </form> in the middle of the table before submit button.

I guess, you added those by hands in plain text editors.

<form method="post" action="logincheck.php">
    <table>
        <tr>
            <td>
                Username
            </td>
            <td>
                <input name="username" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                Password
            </td>
            <td>
                <input name="password" type="password" />
            </td>
        </tr>
        <tr>
            <td>
                <input type="submit" name="Submit" value="Submit" class="submit" />
            </td>
        </tr>
    </table>
</form>
S.Mark
+2  A: 

You have a number of HTML errors, most important being an extra </form> tag shortly after the first <input>. That means the second input and the submit button are outside the form, so it won't work. Firefox and Chrome are being a bit more forgiving here it seems.

Fix your HTML and the form should work fine.

Olly Hodgson
A: 
<form method="post" action="logincheck.php">
  <label for="username">Username</label>
  <input name="username" type="text" />
  <label for="password">Password</label>
  <input name="password" type="password" />
  <input type="submit" name="Submit" value="Submit"  class="submit" />
</form>

The correct code for this form must look like this.

  • You do not need the table, you can style the form with easily with CSS over selecting the label & input fields
Burntime