2 Replies Latest reply on May 29, 2007 4:43 PM by urbanrevolution

    checkbox component not working with form

    urbanrevolution
      ok so i;ve gon back to the down a dirty way of doing this...
      http://www.lightningmedia.com/form_test.php (technical info tab)

      each text field has a Var: Name, email, and company
      i've used the CheckBox component

      i;ve placed the fallowing code on the submit button

      on (release) {
      if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
      EmailStatus = "Please enter a valid E-mail address";
      } else {
      loadVariablesNum("includes/techinfo_signup.php", 0, "POST");
      this.gotoAndStop(2);
      }
      }

      easy enough right?

      everything works fine but the CheckBox......
      i'm trying to send a 1 or 0 to the database.

      i've given the component a
      fieldname: newsletter (the same as the field in the database)
      data type: Boolean
      required: true
      Read only: false
      kind: data
      formatter:none
      encoding:none
      default value:1
      path: includes/techinfo_signup.php
      storage type: simple

      so what am i missing? i'm at a loss...

      thanks again
        • 1. Re: checkbox component not working with form
          Damon Edwards Level 3
          someone correct me if i'm wrong, but you'd handle the data by using
          instancename.value
          • 2. checkbox component not working with form
            urbanrevolution Level 1
            not sure what you mean, sorry ..
            this is the first time i've ever used any kind of a component....
            so i'm shooting in the dark....


            i've put this on teh main time line
            newsletterListener = new Object();
            newsletterListener.click = function() {
            if(newsletter.selected) {
            var visitor_Copy = newsletter.text;
            trace("you will receive a copy")
            }else{
            trace("you will not receive a copy")
            }
            }
            newsletter.addEventListener("click", newsletterListener);

            i can see that on(click) it'll trace the action... but it also lists it as "undefined"
            you will receive a copy
            undefined
            you will not receive a copy
            undefined
            you will receive a copy
            undefined
            you will not receive a copy
            undefined

            but none of this seems to matter to my submit button.

            "crash & burn said the little checkbox."