Re: populate form input option dropdown box from existing data

From: Date: Thu, 18 Jun 2009 12:46:27 +0000
Subject: Re: populate form input option dropdown box from existing data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-294229@lists.php.net to get a copy of this message
Ford, Mike wrote: > On 17 June 2009 15:01, PJ advised: > > >> It does, indeed. This confirms my inexperienced conclusion that >> in_array() does not work on associative arrays per se; it works on >> simple arrays and I just don't have the experience to think of >> extracting only the id fields. >> > > Let's squash this misconception again -- PHP only has associative > arrays, it's just that in most contexts it treats numeric keys > specially. So, internally, array('fred', 'bill', 'joe') is stored > using > exactly the same techniques as array('one'=>'fred', > 'two'=>'bill', > 'three'=>'joe'), but because the first one has numeric keys there are > some things you can do with it that you can't with the second. But > functions such as in_array, where all that really matters is the array's > values, really couldn't care whether the keys are numeric, string, or a > mixture. > Thanks for the explanation. > >> Also, the other problem was the option selected definition required >> Shawn's clarification <select name='component-select' multiple ... >> > which > >> now highlights the selected fields. In all my searches (horrendously >> wasted time) I did not find >> any mention >> of "component-select" either in php.net or w3c.org >> > > I totally don't understand this comment: 'component-select' is just the > name that Shawn chose to give his <select> field -- he could just as > well have named it 'arnold-frog' without it making a blind bit of > difference (so long as every other reference to it was changed to > match!). > The way it was put, I understood that that was the definitive attribute for the field. This confused me even more! > Cheers! > > Mike > > -- > Mike Ford, Electronic Information Developer, > C507, Leeds Metropolitan University, Civic Quarter Campus, > Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom > Email: m.ford@leedsmet.ac.uk > Tel: +44 113 812 4730 > > > To view the terms under which this email is distributed, please go to > http://disclaimer.leedsmet.ac.uk/email.htm > > -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." ------------------------------------------------------------- Phil Jourdan --- pj@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php

« previous php.general (#294229) next »