SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: List/menu error

  1. #1
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Earth
    Posts
    739
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    List/menu error

    Hi,

    I get an error on this:

    PHP Code:
    <select name="tenancy" id="tenancy">
                          <option value="" selected>Select</option>
                          <option <?php echo $tenancy==Own Home 'selected' ''?> value="Own Home">Own Home</option>
                          <option <?php echo $tenancy==Rent 'selected' ''?> value="Rent">Rent</option>
                          <option <?php echo $tenancy==board 'selected' ''?> value="Board">Board</option>
                        </select>
    I think is because of the space in

    <option <?php echo $tenancy==Own Home

    How should it be so it posts it as Own Home .. with the space but still shows selected if form reloads?

    Cheers

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    quotes!
    PHP Code:
    <?php echo $tenancy=='Own Home' 'selected' ''?>
    Spike
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Earth
    Posts
    739
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers ..


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
  •