Some examples:
selectField.options[selectField.selectedIndex].value
or
selectField.options[selectField.selectedIndex].text
or
selectField.options[3].selected

Enjoy,
Mike Chabot

On 10/17/06, Andy Matthews <[EMAIL PROTECTED]> wrote:
> Anyone have an idea on this one? I've tried a few things, but I'm not sure
> how to reference a specific value in a select control.
>
> <!----------------//------
> andy matthews
> web developer
> certified advanced coldfusion programmer
> ICGLink, Inc.
> [EMAIL PROTECTED]
> 615.370.1530 x737
> --------------//--------->
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Andy Matthews
> Sent: Tuesday, October 17, 2006 10:39 AM
> To: [jQuery]
> Subject: [jQuery] best show/hide div code?
>
>
> I'm working on a mailing list manager and one of the options is to provide a
> zip code for emailing anyone in that area. I'd like to hide this field
> unless the user has selected the "Tour Date" option from a select field.
>
> The relevant code is below. The second TR (and it's contents) will be hidden
> by default using CSS, but I want to toggle it's display property when the
> user selects or deselects the "event" option in the "type" dropdown field.
>
> <table>
> <tr class="formBG">
>        <td class="formlabel" align="right">Mailing Type</td>
>        <td>
>                <select name="type">
>                        <option value="general">General Announcement</option>
>                        <option value="store">BCC Store Announcement</option>
>                        <option value="ckc">Clowndergarten 
> Announcement</option>
>                        <option value="event">Event Announcement</option>
>                </select>
>        </td>
> </tr>
> <tr class="formBG">
>        <td class="formlabel" align="right">Zip Code of event<br><i
> class="smaller">for event announcement only</i></td>
>        <td><input type="text" name="zip" id="zipfield" class="zcinput"></td>
> </tr>
> </table>
>
> How would I do this with jQuery?
>
> <!----------------//------
> andy matthews
> web developer
> certified advanced coldfusion programmer
> ICGLink, Inc.
> [EMAIL PROTECTED]
> 615.370.1530 x737
> --------------//--------->
>
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to