Loading ...
Sorry, an error occurred while loading the content.

Connection Manager: problem with setForm and checkboxes

Expand Messages
  • romadur22
    Wit YUI 0.12.2 I run in a problem when transforming the values from the checkboxes. setForm transfers only the selected value on but not the deselected
    Message 1 of 3 , Feb 28, 2007
    View Source
    • 0 Attachment
      Wit YUI 0.12.2 I run in a problem when transforming the values from
      the checkboxes. setForm transfers only the selected value "on" but not
      the deselected value. In the case, that the checkbox is deselected,
      there will be noting transferred. Example:

      <input type="checkbox" id="checkBox" name="checkBox"></input>
      <input type="button" value="show checkbox"
      onclick="window.alert(YAHOO.util.Connect.setForm('form'))">

      In the case, the checkbox is on, the alert shows "checkbox=on"
      In the case, the checkbox is off, setForm answers an empty string. I
      would expect "checkbox=off"

      Any thoughts what did I wrong?

      Regards Thomas
    • tssha
      ... That is the expected behaviour when the checkbox isn t selected. To see this in action, take an HTML form with checkboxes and submit it to any backend,
      Message 2 of 3 , Feb 28, 2007
      View Source
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "romadur22" <romadur22@...> wrote:
        >
        > Wit YUI 0.12.2 I run in a problem when transforming the values from
        > the checkboxes. setForm transfers only the selected value "on" but not
        > the deselected value. In the case, that the checkbox is deselected,
        > there will be noting transferred. Example:
        >
        > <input type="checkbox" id="checkBox" name="checkBox"></input>
        > <input type="button" value="show checkbox"
        > onclick="window.alert(YAHOO.util.Connect.setForm('form'))">
        >
        > In the case, the checkbox is on, the alert shows "checkbox=on"
        > In the case, the checkbox is off, setForm answers an empty string. I
        > would expect "checkbox=off"

        That is the expected behaviour when the checkbox isn't selected. To
        see this in action, take an HTML form with checkboxes and submit it to
        any backend, without using Connection Manager.

        Regards,
        Thomas
      • romadur22
        ... Hi Thomas, Yes, you are correct. Thank you very much for this explanation! Regards Thomas
        Message 3 of 3 , Mar 1, 2007
        View Source
        • 0 Attachment
          > > In the case, the checkbox is on, the alert shows "checkbox=on"
          > > In the case, the checkbox is off, setForm answers an empty string. I
          > > would expect "checkbox=off"
          >
          > That is the expected behaviour when the checkbox isn't selected. To
          > see this in action, take an HTML form with checkboxes and submit it to
          > any backend, without using Connection Manager.
          >
          > Regards,
          > Thomas

          Hi Thomas,

          Yes, you are correct. Thank you very much for this explanation!

          Regards Thomas
        Your message has been successfully submitted and would be delivered to recipients shortly.