Results 1 to 2 of 2

Thread: How to submit checkboxes with the same name?

  1. #1
    Sencha User
    Join Date
    Mar 2008
    Vote Rating

    Default How to submit checkboxes with the same name?


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

    <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/>
    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
    Vote Rating

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts