FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » populate pulldownbox from query
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: populate pulldownbox from query [message #174089 is a reply to message #174088] Sat, 21 May 2011 11:39 Go to previous messageGo to previous message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma:
Member
On 21 mei, 13:00, t...@mountifield.org (Tony Mountifield) wrote:
> In article <cddfd7a4-dfb5-48c0-8ecc-e2c86baaf...@glegroupsg2000goo.googlegroups.com>,
>
> Co  <comp(dot)lang(dot)php(at)googlegroups(dot)com> wrote:
>> I don't think the formatting is the problem.
>> The problem is that the values are not set in the pulldownbox.
>> It does populate the box with the names but the value from the database
>> for the current record is not displayed.
>
>> Marco
>
> What you need to do, within the loop that outputs the <option> elements,
> is to check the value(s) in the row to see if this is the element that
> should be currently displayed, and it so, you need to add the "selected"
> tag to the <option> element, e.g.
>
> <option id="$id" selected>$optiontext</option>
>
> For all other options, omit the "selected".
>
> Cheers
> Tony
> --
> Tony Mountifield
> Work: t...@softins.co.uk -http://www.softins.co.uk
> Play: t...@mountifield.org -http://tony.mountifield.org

should that be in this sentence?
echo "<option value=$nt[id]>{$nt['rank']} {$nt['firstname']}
{$nt['lastname']} </option>";

Marco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: he
Next Topic: Detecting Redirected Output
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 22:32:43 GMT 2024

Total time taken to generate the page: 0.04150 seconds