SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how do I add a <br /> in a form?

    Hi I've made a php lookup and I want to add a br tag in the <form>
    but It wont let me.
    Can anyone help?


    PHP Code:
    <form action="test.php" method='post'>

    <label><input type='submit' name='submit'/></label><br /><br />


    <select name="test" size="1">
    <option selected value="">SELECT ONE</option>
    <option value="">--------</option>
    <label><input='' name=''/></label><br/>
    <?php 
    while
    (
    $testid mysql_fetch_array($result)){
    $test $testid['testid'];
    $ytest htmlspecialchars($testid['testid']);
    echo 
    "<option value='$test'>$ytest<br/></option>\n";


    }

    //////////// =>I want to and a <br /> here<=

    echo "<select name='test' size='1'>";
    echo 
    "<option value='$test'>$test</option>\n";







    echo 
    "<br /><input type='submit' value='Submit'>\n";
    ?>


    <br/><br/>
    </form>
    And thanks in advance.

  2. #2
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    662
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You forgot to close 2 select elements with </select>

    Using fieldset or div is better than using breaks by the way.
    Tweep List adds an avatar menu to Twitter (open source) ---------- Word Stats shows your most used words on Twitter

  3. #3
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have two submit buttons. Do you want one or two forms? You are missing the closing select tag for both your select fields, and the closing form tag for your form(s).

  4. #4
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I do have a form closing tag.
    and I didn't mean to have two submit buttons.
    and Glenn thanks I didn't notice I didn't have ending select tags.
    I fixed that and It worked, so thanks!


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
  •