I got it fixed by using this:

$("#initCond").each(function(){

instead of this:

$("#initCond").click(function(){

So the corrected, full statement is this:

$("#showgraph").click(function(){
                // Only unhide the Overlay controls if Initial
Conditions are
set to No.
                $("#initCond").each(function(){
                       if ($(this).val() == 'no')
{                                              {
                                                        $
("#overlaybutt,#addoverlay").show("slow");
                                                }
                        return false;
                        });
                return false;
           });

Thanks for helping!



On Jun 26, 10:37 am, Will <[EMAIL PROTECTED]> wrote:
> Thanks for the response.  I'm still having trouble getting this to
> produce any results.  Perhaps I'm not initiating it correctly, as
> nothing seems to happen as a result of this:
>
> $("#showgraph").click(function(){
>                 // Only unhide the Overlay controls if Initial Conditions are
> set to No.
>                 $("#initCond").click(function(){
>                        if ($(this).val() == 'no'){                            
>                   {
>                                                         
> $("#overlaybutt,#addoverlay").show("slow");
>                                                 }
>                         return false;
>                         });
>                 return false;
>            });
>
> Or this:
>
> $("#showgraph").click(function(){
>                 // Only unhide the Overlay controls if Initial Conditions are
> set to No.
>                 $("#initCond").click(function(){
>                        if (this.options[this.selectedIndex].value ==
> 'no'){
>                                                         
> $("#overlaybutt,#addoverlay").show("slow");
>                                                 }
>                         return false;
>                         });
>                 return false;
>            });
>
> No errors reported or anything -- it's as if the whole function is
> being passed over.
>
> Any thoughts?
>
> On Jun 25, 3:52 pm, MorningZ <[EMAIL PROTECTED]> wrote:
>
> > "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