Re: [PHP] jquery fill select option value

[email protected] (Jim Giner)
Newsgroups php.general
Message-ID <[email protected]>
On 9/22/2013 3:52 AM, Ashley Sheridan wrote:
>
>
> iccsi <[email protected]> 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,
>>
>> Regards,
>>
>> Iccsi,
>
> Yes it is possible but a) not at server side because JavaScript is run on the browser, and b) this is a PHP list not a JavaScript list.
>
> Saying that, why aren't you populating it on the server side with PHP?
>
> Thanks,
> Ash
>
Not sure what you are asking.  With PHP it is possible to have a specifi 
item from the options selected in the drop down when the page is loaded. 
  With JS it is possible to capture the newly selected option value and 
place it in another field, if that is what you want.  Obviously when the 
user clicks on an option, that value IS placed in the select tag for 
processing at the server side by PHP on submit.

So what is it you want to accomplish?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.