double == in your if statements might do the job.

2009/8/19 Nick Moy <nick....@gmail.com>

>
> When the if else statements are removed, they are not perpetually
> checked.
>
> On Aug 19, 4:34 pm, labbit <nick....@gmail.com> wrote:
> > Hello,
> >
> > I'm trying to write an if else statement in javascript so that when a
> > check box is checked, a table will appear, and when it is checked
> > again, another box will appear.  However, the checkbox is constantly
> > marked as checked, and I do not know why.  I did not set any checked
> > attritube to false or true.  What gives?
> >
> > function GetStoryPoints() {
> >             var ownerCheck;
> >             var creatorCheck;
> >
> >             if (document.getElementById("ownCheck").checked = true)
> >                 ownerCheck = true;
> >             else
> >                 ownerCheck = false;
> >
> >             if (document.getElementById("createCheck").checked = true)
> >                 creatorCheck = true;
> >             else
> >                 creatorCheck = false;
> >
> >             if (ownerCheck && creatorCheck) {
> >                 $.post('/StoryPoint/ListSpecific?retrieveOwned=' +
> > ownerCheck + '&retrieveCreated=' + creatorCheck + '&creatorID=' + $
> > ("#UserList > option:selected").attr("value"), null, function(data) {
> >                     $("#storyPointDetail").html(data);
> >                 }, "html");
> >             }
> >             else if (ownerCheck && !creatorCheck) {
> >                 $.post('/StoryPoint/ListSpecific?retrieveOwned=' +
> > ownerCheck + '&retrieveCreated=' + creatorCheck + '&creatorID=' + $
> > ("#UserList > option:selected").attr("value"), null, function(data) {
> >                     $("#storyPointDetail").html(data);
> >                 }, "html");
> >             }
> >             else if (!ownerCheck && creatorCheck) {
> >                 $.post('/StoryPoint/ListSpecific?retrieveOwned=' +
> > ownerCheck + '&retrieveCreated=' + creatorCheck + '&creatorID=' + $
> > ("#UserList > option:selected").attr("value"), null, function(data) {
> >                     $("#storyPointDetail").html(data);
> >                 }, "html");
> >             }
> >         }
>

Reply via email to