1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    82
    Vote Rating
    0
    safewolf is on a distinguished road

      0  

    Default How to submit checkboxes with the same name?

    hi,everyone

    in pure html, we can use some checkboxes with the same name like this:

    Code:
    <form>
    <input type="checkbox" name="chk" value=1/>
    <input type="checkbox" name="chk" value=2/>
    <input type="checkbox" name="chk" value=3/>
    <input type="checkbox" name="chk" value=4/>
    <input type="checkbox" name="chk" value=5/>
    </form>
    if i check 1,2,3 and submit the form,i can get the chk in server side with the value "1,2,3"

    but if i use the chekboxes with the same name in the extjs,i can only get the last chk value 3 in server side.

    how should i do that i can submit the chechboxes like in pure html form?

  2. #2
    Sencha User
    Join Date
    Feb 2008
    Posts
    84
    Vote Rating
    0
    danellison is on a distinguished road

      0  

    Default use CheckBoxGroup

    Off the top of my head I think you need to use the CheckBoxGroup class to pull this off. You may have to override the getValues method but I seem to recall that Ext will promote the checkboxes to an array. Give it a try. If it doesn't work then override the getValues method to return what you want fromt he group.

    Hope that helps.

    Dan

Thread Participants: 1