Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

on submit, an extra blank value is being passed #12

Open
gunnrryy opened this issue Apr 1, 2017 · 0 comments
Open

on submit, an extra blank value is being passed #12

gunnrryy opened this issue Apr 1, 2017 · 0 comments
Labels

Comments

@gunnrryy
Copy link

gunnrryy commented Apr 1, 2017

Hi,
its a question, not an actual issue. but in my case no. of fields being too many it makes an issue for me to cutdown the not-required things from my url.

<?= $form->field($model, 'product_type_id')->dropDownList(ArrayHelper::map(ProductTypes::find()->all(), 'id', 'name'), ['multiple' => true]); ?>
the dropdown with multi-select is generated properly and working fine. but when submitted,

the query params being generated are like below

myForm%5Bproduct_type_id%5D=&myForm%5Bproduct_type_id%5D%5B%5D=1&myForm%5Bproduct_type_id%5D%5B%5D=2

url decoded as
myForm[product_type_id]=&myForm[product_type_id][]=1&myForm[product_type_id][]=2

the first myForm[fieldName]=& the desired outcome? just curious to know.
though it doesn't have any issue, as the later part over-writes the 1st blank.
has anyone else noticed this ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants