Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Form within Table

Options
  • 28-03-2009 11:46am
    #1
    Registered Users Posts: 757 ✭✭✭


    Hi all,

    I want to put a form on my page but to facilate layout I want to put it into a table. When I have
    <form name="form1" method="post" action="checklogin.php"> 
    <center>UserID:<input name="myusername" type="text" id="myusername"></center><br />
    <center>Password:<input type="password" size="15" maxlength="15" name="mypassword" id="mypassword"></center><br />
    <center><label><input name="LoginButton" type="submit" value="Login"></label></center><br />
    </form>
    

    it works perfectly. but when I have
    <form name="form1" method="post" action="checklogin.php"> 
    <table border="0" cellspacing="20" cellpadding="0" width="300" align="center">
      <tr>
        <td ><p align="left">   User ID:</td>
        <td width="30">
          <input name="myusername" type="text" id="username" size="60" maxlength="50" ></td>
      </tr>
      <tr>
        <td><p align="left">Password:</td>
         <td width="30">
         <input name="password" type="text" id="username" size="60" maxlength="15" ></td>
      </tr>
    </table>
    <p align="center"><input class="submitButton" name="Login" type="submit" value="Submit"></p>
    </form>
    

    it doesnt work. Can someone help me out here as to how I can still get it to work?


Comments

  • Closed Accounts Posts: 1,200 ✭✭✭louie


    What exactly do you mean by "It Doesn't work?"

    Actually looking at it you have id="username" twice and password name field is "password" while on the first form is "mypassword".


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    Ditto what louie said - also why are you using <p> inside the <td> tag? That's going to cause all sorts of layout problems for you. Try getting rid of the <p> tags and using the <td> tags own align="" attribute to set the text left of right.


  • Registered Users Posts: 757 ✭✭✭Signpost


    ok now I feel sort of thick... Thanks lads


  • Registered Users Posts: 2,554 ✭✭✭LowOdour


    Signpost wrote: »
    ok now I feel sort of thick... Thanks lads

    Hey, if you cant be thick here where can you can you be!


  • Closed Accounts Posts: 2,046 ✭✭✭democrates


    Signpost wrote: »
    ok now I feel sort of thick... Thanks lads
    I've been coding since 1984 and I still make mistakes. I plan to make many more because the fastest way to learn involves a mix of traditional academic learning and 'try it and see'.
    The latter approach is absolutely necessary in web development since standards aren't followed strictly by all browsers, so just keep doing what you're doing, it's all good :)


  • Advertisement
Advertisement