Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Chtml::button() Submit Attribute Does Not Work Within A Form With Get Method

$
0
0
I have a simple form as below, with two buttons that have 'submit' attribute. If the method attribute of the form is POST, then clicking on each button will submit to its 'submit' URL (this is right). But if the method attribute is GET, then clicking button always submits to the URL of the form. Is this a bug?
I'm using yii 1.1.13
<?php
$form = $this->beginWidget('CActiveForm', array(
  'id' => 'search-form',
  'action' => array('index'),
  'method' => 'get',
));
echo CHtml::button('Search 1', array(
  'submit' => array('search1'),
));
echo ' ';
echo CHtml::button('Search 2', array(
  'submit' => array('search2'),
));
$this->endWidget();
?>

Thanks.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>