I've changed it a little bit, so it doesn't show/hide the div, it's
meant to disable the input elements:
Can anyone see why ticking it works, but unticking it leaves the input
tags disabled still?

                        <script type="text/javascript">
                        $(document).ready(function(){
                                $("#show_resolve").click(function () {
                                        if ($("#show_resolve").is(":checked"))
                                        {
                                                
$(".submit_problem_form_right").children(":input").attr
("disabled", "disabled");
                                        }
                                        if ($("#show_resolve").is(":checked"))
                                        {
                                                
$(".submit.problem_form_right").children(":input").removeAttr
("disabled");
                                        }
                                });
                        });
                        </script>

Thank you!


On Aug 7, 1:43 pm, "Jonathan Vanherpe (T & T NV)" <jonat...@tnt.be>
wrote:
> You'll have to run the whole function block within
> $("#show_resolve").click() on load (ie. put it somewhere in
> $(document).ready(function(){}).
>
> Make it a seperate function so you can avoid copy/pasting the whole thing
>
> Jonathan
>
>
>
> Samuurai wrote:
> > Hi,
>
> > This is my first little foray into JQuery, so far i'm impressed,
> > having had very little JS experience, I was able to create the result
> > I wanted very qucikly and easily!
>
> > However, I'm having one little niggle...
>
> > Here's my code:
> > [code]
> >                    $(document).ready(function(){
> >                                    
> > $(".submit_problem_form_right").css("visibility","hidden");
> >                                    
> > $("#left_submit").css("visibility","visible");
> >                                    $("#show_resolve").click(function () {
> >                                    if ($("#show_resolve").is(":checked"))
> >                                    {
> >                                            
> > $(".submit_problem_form_right").css("visibility","visible");
> >                                            
> > $("#left_submit").css("visibility","hidden");
> >                                    }
> >                                    else
> >                                    {
> >                                            
> > $(".submit_problem_form_right").css("visibility","hidden");
> >                                            
> > $("#left_submit").css("visibility","visible");
> >                                    }
> >                            });
> >                    });
> > [/code]
>
> > This works fine.. ticking the checkbox shows and hides the div.
> > However, if I check the checkbox and refresh the page, the checkbox
> > remains ticked, but the div is hidden.
>
> > Any ideas how I can make it work reliably?
>
> --
> Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be

Reply via email to