Re: jquery fill select option value

From: Date: Sun, 22 Sep 2013 16:57:42 +0000
Subject: Re: jquery fill select option value
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-322146@lists.php.net to get a copy of this message
On Sep 22, 2013, at 12:47 PM, Jim Giner <jim.giner@albanyhandball.com> wrote: > On 9/22/2013 12:04 PM, Tedd Sperling wrote: >> On Sep 21, 2013, at 9:06 PM, iccsi <inungh@gmail.com> wrote: >>> <select id="mark" name="mark"> >>> <option value="">--</option> >>> <option value="bmw">BMW</option> >>> <option value="audi">Audi</option> >>> </select> >>> >>> I use above code to have my select drop down on the form and would like to use jQuery >>> to fill option value on change event. >>> I would like know is it possible to do, if yes, any hint or example code at server site >>> is appreciated, >>> >>> Your help and information is great appreciated, >> >> While jQuery is great, you don't need jQuery for this -- a simple AJAX routine will do >> what you want. Here's an example: >> >> http://php1.net/a/zipcode-states/ >> >> The ajax routine is there -- you can copy it. >> >> The HTML is there -- you can copy that too. >> >> The php script is a simple script that is triggered by an ajax script (triggered by the >> user via onchange() ) that then pulls whatever data is needed to populate the remaining option >> controls via a GET. >> >> HTH's >> >> tedd >> >> > OH!!! So you want to populate another(!) select box after the user makes his first selection. > You didn't say that. Well... not meaning to disagree -- but he did say: > I use above code to have my select drop down on the form and would like to use jQuery to fill > option value on change event. I took that to mean fill "another" option control. Why would one want to change the values of the current one? tedd _______________ tedd sperling tedd.sperling@gmail.com

« previous php.general (#322146) next »