"this.value" not get the value of a <select>

use

if ($(this).val() == 'no')

instead

or you can just use what jQuery does under the hood and say

if (this.options[this.selectedIndex].value == 'no')





On Jun 25, 11:13 am, Will <[EMAIL PROTECTED]> wrote:
> I have a button (#showgraph) that submits a form, but when this
> happens, I want a certain div (#overlaybutt) to appear only if a
> certain value ('no') is present in one of the select options
> (#initCond).
>
> Here's what I have so far, which isn't working:
>
> $("#showgraph").click(function(){
>            // Only unhide the Overlay controls if Initial Conditions are set
> to No.
>                 $("#initCond").change(function() {
>                 if (this.value == 'no')
>                                                 {
>                                                                 
> $("#overlaybutt").show("slow");
>                                                 }
>                                                 return false;
>                                 });
>
>                 return false;
>            });
>
> How would I show #overlaybutt only if the value of the #initCond
> select box is set to 'no'?
>
> Thanks!

Reply via email to