1

I have widget called List builder, which i used to sort list of contacts. when i submit the form the, i should get these sorted list of contacts in my $_POST array.

I am getting the content from CGridview widget but not from the following widget:

$this->widget('ext.widgets.multiselects.XMultiSelects',array(
'leftTitle'=>'Email',
'leftName'=>'Contactlist[email][]',
'leftList'=>Contactlist::model()->findUsersByemail( ),
'rightTitle'=>'Email-List',
'rightName'=>'Contactlist[email][]',
//'rightList'=>Contactlist::model()->findUsersByemail( ),
'rightList'=>array(),
'size'=>20,
'width'=>'200px',
));

How to submit this widget data, so that i can access it from $_POST array? Here is the code generated by this widget:

<form id="yw0" action="/amantran/index.php?r=invmgmt/contactlist/admin" method="get">
<div class="row">
    <label for="Contactlist_econtact">Econtact</label>      <input size="10" maxlength="10" name="Contactlist[econtact]" id="Contactlist_econtact" type="text" />   </div>

<div class="row">
    <label for="Contactlist_fname">Fname</label>        <input size="40" maxlength="40" name="Contactlist[fname]" id="Contactlist_fname" type="text" /> </div>

<div class="row">
    <label for="Contactlist_lname">Lname</label>        <input size="25" maxlength="25" name="Contactlist[lname]" id="Contactlist_lname" type="text" /> </div>

<div class="row">
    <label for="Contactlist_email">Email</label>        <input size="50" maxlength="50" name="Contactlist[email]" id="Contactlist_email" type="text" /> </div>

<div class="row">
    <label for="Contactlist_mobile">Mobile</label>      <input size="10" maxlength="10" name="Contactlist[mobile]" id="Contactlist_mobile" type="text" />   </div>

<div class="row">
    <label for="Contactlist_address">Address</label>        <input size="50" maxlength="50" name="Contactlist[address]" id="Contactlist_address" type="text" /> </div>

<div class="row buttons">
    <input type="submit" name="yt0" value="Search" />   </div>

enter image description here

satya
  • 31
  • 7
  • Please provide html that is generated by this widget – Andrii Mishchenko Apr 07 '14 at 12:30
  • Check generated html code – Alex Apr 07 '14 at 16:13
  • It's not letting me post images, since i dont have enough reputation. please refer this: http://www.yiiframework.com/forum/index.php/topic/53152-how-to-get-widget-data-in-post-method-of-form-submission/page__p__245067__fromsearch__1#entry245067 – satya Apr 08 '14 at 08:40

1 Answers1

0

You are having method="get" in your form, change it to method="post"

Alex
  • 8,055
  • 7
  • 39
  • 61