try this
$("#Organisations").change(function(){
$("#organisation").attr('value', $(this).attr('value') );
});
Regards,
Ritesh
Alexandre Plennevaux-2 wrote:
>
> hello!
>
> i'm trying to have the selected option's value in a select element
> populate an input field.
>
> i tried this:
>
> <script type="text/javascript">
> $(document).ready(function(){
> $('#allOrganisations').change(function() {
> $("#organisation").attr("value", $("option",this).val());
> });
> });
> </script>
>
> it kind of work, but it always give the same value, no matter what the
> user picks. Is there a way to know which option is selected ?
>
> i looked in the documentation, and :selection is not supported.
>
> any idea?
>
> thank you,
>
> Alex
>
>
> Alexandre Plennevaux - LAb[au] asbl.vzw / MediaRuimte
> Lakensestraat/Rue de Laeken 104
> B-1000 Brussel-Bruxelles-Brussels
> Belgie-Belgique-Belgium
>
> Tel:+32(0)2.219.65.55
> Fax:+32(0)2.426.69.86
> Mobile:+32(0)476.23.21.42
> HYPERLINK "blocked::http://www.lab-au.com/"http://www.lab-au.com
> HYPERLINK "blocked::http://www.mediaruimte.be/"http://www.mediaruimte.be
>
> HYPERLINK
> "blocked::http://www.mediaruimte.be/"__________________________________________________________________________
>
> The information in this e-mail is intended only for the addressee named
> above. If you are not that addressee, please note that any disclosure,
> distribution or copying of this e-mail is prohibited.
> Because e-mail can be electronically altered, the integrity of this
> communication cannot be guaranteed.
>
> __________________________________________________________________________
>
>
>
> --
> Ce message Envoi est certifié sans virus connu.
> Analyse effectuée par AVG.
> Version: 7.5.441 / Base de données virus: 268.17.37/682 - Date: 12/02/2007
> 13:23
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
--
View this message in context:
http://www.nabble.com/Get-the-selected-option-of-a-select-element-tf3220483.html#a8944227
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/