Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Form within Table

  • 28-03-2009 11:46AM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 757 ✭✭✭Signpost


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


  • Registered Users, Registered Users 2 Posts: 2,791 ✭✭✭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