On 26 Giu, 05:08, Brad <[EMAIL PROTECTED]> wrote:
> Your options should have "value" attributes and not "name".
>
> <select name="textselector">
> <option value="11">Text</option>
> <option value="12">Text 2</option>
> </select>
>
> Try something like
>
> $("textselector option:selected").val();

This works, but since the selected option is the actual value of the
<select>, I would do something like this:

var x;
$('select[name=textselector]').change(function(){
    x = $(this).val();
});

while keeping the names (if that is really what you want):

var x;
$('select[name=textselector]').change(function(){
    x = $(this).children('option:selected').attr('name');
});

Reply via email to