SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,658
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    form all on 1 line?

    Im trying to figure out how to put my form so its on a single line.
    http://scasp.com/testing/reviews.php
    Any help would be nice, thanks.
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,336
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    start by validating your html

    i'm pretty sure you cannot embed the form inside a fieldset
    Code:
    <fieldset>
     <legend>Search</legend>
       <form action="" method="POST">
         <p><label>ASP Name:</label></p>
           <select name="name" size=1>
           <option ...
           </select>
         <p><label>Start Date:</label></p>
           <select name="SDate" size="1">
           <option ...
           </select>
         <p><label>End Date:</label></P>
           <select name="EDate" size="1">
           <option ...
           </select>
         <input name="search" type="submit" ...> 
      </form>
    </fieldset>
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use the label and don't include the form field within it, you need a "for" attribute, important, the "for" attribute relates to the id attribute (mind you: id's are unique across your page, you have some multiple ids on your page!) of the form field and not to the name attribute, if no id is provided it doesn't work in some browsers.

    HTML Code:
    <label for="name">ASP Name:</label> <select name="name" id="name"> ....
    Alternatively:
    HTML Code:
    <label>ASP Name: <select name="name" id="name"> .... </label>
    now, to answer the original question, if you want something in one single line, you should not wrap each separate part of it in paragraphs <p> </p>, here is the code a bit simplified:
    HTML Code:
    <form action="" method="post">
    <fieldset>
    <legend>Search</legend>
    <label>ASP Name: 
    	<select name="name" id="name" size=1>
    		<option value="test">test</option>
    		<option value="Melissa">Melissa</option>
    	</select>
    </label>
    
    <label>Start Date:
    	<select name="SDate" id="SDate" size="1">
    		<option value="2006-06-24">2006, June, 24</option>
    		<option value="2006-06-23">2006, June, 23</option>
    	</select>
    </label>
    
    <label>End Date:
    	<select name="EDate" id="EDate" size="1">
    		<option value="2006-06-24">2006, June, 24</option>
    		<option value="2006-06-23">2006, June, 23</option>
    	</select>
    </label>
    <input name="search" id="search" type="submit" value="Search" class="btn" />
    </fieldset>
    </form>
    Dan G
    Marketing Strategist & Consultant

  4. #4
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,658
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    thank you
    "Oh, and Jenkins--apparently your mother died this morning."


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •