0

I have a problem here which i am working quite a while but do not have any ideas left for a solution. I will try to make it short:

I use the eColumns extension for the admin and the view module in yii. I added a combobox to select views which are saved in the database so that users can build their own selection of select columns for each table, however:

In eColumns i added a button to delete an already created selection and an input field to give the selection a name

CHtml::button('', array('type' => 'submit','name' => 'btn_delete','value' => 'Ansicht löschen', 'onclick' => '$("#'.$this->getId().'").dialog("close");', 'style' => 'align: left', 'confirm'=>'Sind sie sicher das sie diese Ansicht löschen möchten?'));

CHtml::textField('input_name', substr($this->selectedView,strpos($this->selectedView,"@@")+2), array('size'=>30,'maxlength'=>200));

If i click the button in the view-module everything works as expected. $_POST is filled with "input_name" and "btn_delete". However if i this same code included in the admin-module only input_name is filled - btn_delete is simply not set if i click the button.

Anybody can i give me any hint what i can check?

Thanks in advance! :)

calimero
  • 35
  • 4

1 Answers1

1

If you are using jQuery serialize() to collect form elements in your admin-module, jQuery serialize() will not serialize any submit button value.

See also serialize example, hope this will help. :)

=== links to jsfiddle must be accompanied by code.. ===

html

<form>
<input type="text" name="text" value="text-value">
<input type="submit" name="submit-btn" value="button-value">    
</form>
<span name="result-serialize"></span>

jQuery

var serializeString = $("form").serialize();
$("span[name=result-serialize]").text(serializeString);
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
hermes
  • 41
  • 3
  • Hi, thank you very much. It wasnt really the solution to my problem but it let me on the right track :) The problem was that the eColumns.php contained a script which fetched the submit and instead only upgraded the CGridView. I deleted that part and now it works perfectly – calimero May 20 '14 at 08:32