3 Replies Latest reply on Jan 25, 2009 8:14 AM by Newsgroup_User

    Problems with checkboxes

    JeanNiBee
      Hi

      when I create a form, very basic one from the "Flex in a Week tutorial" the checkboxes can be selected (or 'checked') but not unchecked.

      I couldn't find any setting that may persist it's state or something like that.

      This happens in all browsers when I compile my app. Chroms, Firefox, IE.

      thanks.
        • 1. Re: Problems with checkboxes
          John Hall Level 4
          And the line of script for the checkbox is plain vanilla? No bindings from anywhere in the application? Is the selected property referred to in any script?
          • 2. Re: Problems with checkboxes
            Level 7

            "JeanNiBee" <webforumsuser@macromedia.com> wrote in message
            news:gli28q$28p$1@forums.macromedia.com...
            > Hi
            >
            > when I create a form, very basic one from the "Flex in a Week tutorial"
            > the
            > checkboxes can be selected (or 'checked') but not unchecked.
            >
            > I couldn't find any setting that may persist it's state or something like
            > that.
            >
            > This happens in all browsers when I compile my app. Chroms, Firefox, IE.

            Probably the best way is to use a back-end technology to save settings to a
            server. However, you could also use a SharedObject for a quick win without
            using back end technology.


            • 3. Re: Problems with checkboxes
              JeanNiBee Level 1
              actually I found it.

              classic coding error...

              "Script" being called on click().

              if( sameAsHome.selected = true ) {
              mailAddress.text = homeAddress.text;
              mailCity.text = homeCity.text;
              mailProvince.selectedIndex = homeProvince.selectedIndex;
              mailPostal.text = homePostal.text;
              } else {
              mailAddress.text = "";
              mailCity.text = "";
              mailProvince.selectedIndex = 0;
              mailPostal.text = "";
              }

              Should have been:

              if( sameAsHome.selected == true ) { // stuff }

              ONE versus TWO erqual signs.

              ONE = assign the value (evertime I checked/unchecked I was setting it back to checked)
              TWO == comparison operator.

              Enjoy.