#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Nobbies beach, Gold Coast. It's beautiful.
    Posts
    2,572
    Rep Power
    171

    Can someone please explain to me where do the <from></form> tags go?


    Hello;
    In a page with multiple forms in it, where do the form tags go anyways? Thanks
    For example:
    Code:
    <html>
    	<body>
    		
            <table>
            	<tr>
                	<td><form action="1" >
                    </td>
                    <td>Name:<input type="text" />
                    </td>
                    <td>Email:<input type="text" />
                    </td>
                    <td><input type="submit" />
                    </td>
                     <td></form>
                    </td>
                 </tr>
            </table>
            </form>
            <table>
            <form action="2">
            	<table>
                    <tr>
                        <td>Name:<input type="text" />
                        </td>
                        <td>Email:<input type="text" />
                        </td>
                        <td><input type="submit" />
                        </td>
                     </tr>
                 </table>
              </form>
    		</table>
            <div id="form3">
            	<form action="3">
                	 Name:<input type="text" />
                        Email:<input type="text" />
                       <input type="submit" />
                 </form>
            </div>
    	</body>	
    </html>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,868
    Rep Power
    368
    if you have multiple forms, then treat them all as separate!
    Code:
    <form>
    
    </form>
    
    .....
    
    
    <form>
    
    </form>
    
    ....
    etc
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    1
    Rep Power
    0

    Hello


    As per me the <form> tags must be place whereever you want to create a form for the website but make sure that the tag must be closed where is form is getting completed.
  6. #4
  7. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Nobbies beach, Gold Coast. It's beautiful.
    Posts
    2,572
    Rep Power
    171
    Thank you for replies. But I need more details.

    An example on a page with 4 forms in it.

    Thanks
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    829
    Rep Power
    275
    it appears that these 2 ways are correct
    Code:
    <!-- using table with form -->
            <table style="border-collapse:collapse;">
            	<tr>
                	<td>
                      <form action="1">
                           Name:<input type="text" /><br />
                           Email:<input type="text" /><br />   
                           <input type="submit" />
                     </form>
                    </td>
                 </tr>
            </table>
            
    <!-- using div with form -->
            <div id="form3">
            	<form action="3">
                	 Name:<input type="text" /><br />
                     Email:<input type="text" /><br />
                     <input type="submit" />
                 </form>
            </div>
    remove the <br /> if you don't want each input on new line.
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    The Pleiades
    Posts
    294
    Rep Power
    8
    Code:
    <form action="action_file.php" method="post" name="testform1">
    <fieldset>
    <legend>Name of Form</legend>
       <p><label for="name">Name:</label><input type="text" name="username" id="name" /></p>
    <p><label for="name">Name:</label><input type="text" name="username" id="name" /></p>
    </fieldset>
    </form>
    Then style all the separate elements in the CSS file.

    Regards,

    Nanomech.
  12. #7
  13. No Profile Picture
    buildmyweb.org
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Location
    NY
    Posts
    62
    Rep Power
    7
    i agree with DonR on using a table for layout. however, i code using CSS floats. so my form is more like this:

    Code:
    <form id="" action="" method="post">
    <div class="form_txt">First Name</div>     <div class="form_input"><input type='text' name='f_name' /></div> 
    </form>
    in my external css, each div is given set width and floated left. so it functions like a table.
    Freelance Web Developer | Web Hosting |
    PHP Applications
    Web Development, Hosting, Graphic Design, SEO

IMN logo majestic logo threadwatch logo seochat tools logo