[CLOSED] Controlling how a checbox value is submitted in a formpanel

  1. #1

    [CLOSED] Controlling how a checbox value is submitted in a formpanel

    Hi,

    If I have a bound checkbox in a formpanel:


                                <ext:Checkbox ID="IsArchived" runat="server" FieldLabel="Archived" DataIndex="IsArchived" />
    When I save the formpanel, if the checbox is checked the form data contains IsArchived=IsArchived but if not it doesn't submit anything for isArchived.

    What I want, is for it to submit IsArchived=true if selected, else IsArchived=false. Can I do this ?

    Many thanks
    Last edited by Daniil; Feb 02, 2012 at 12:18 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Well, it's the standard CheckBox behavior.

    I can suggest to set up SubmitValue="false" for the CheckBox and pass its value manually via BaseParams.

    Example
    <ext:FormPanel runat="server">
        <Items>
            <ext:TextField ID="TextField1" runat="server" Text="Hello!" />
            <ext:Checkbox ID="Checkbox1" runat="server" SubmitValue="false" />
        </Items>
        <BaseParams>
            <ext:Parameter Name="Checkbox1" Value="Checkbox1.getValue()" Mode="Raw" />
        </BaseParams>
    </ext:FormPanel>
  3. #3
    Great, thanks!

Similar Threads

  1. [CLOSED] [1.0] Hidden Fields Not Being Submitted
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 25, 2011, 8:23 PM
  2. Controlling EventMask
    By koss in forum 1.x Help
    Replies: 2
    Last Post: Nov 12, 2009, 11:37 AM
  3. Determine if the Fieldset checbox is selected
    By n_s_adhikari@rediffmail.com in forum 1.x Help
    Replies: 2
    Last Post: Aug 06, 2009, 6:15 PM
  4. Submitted data too big
    By marcossoft in forum 1.x Help
    Replies: 9
    Last Post: Jul 27, 2009, 7:26 PM
  5. checbox check listener
    By [WP]joju in forum 1.x Help
    Replies: 2
    Last Post: Apr 21, 2009, 8:08 AM

Posting Permissions