Commits

Nikola Kovacs  committed ef30996

Add formSubmit and formButton types to TbButton, for use in forms.

These generate "input" tags instead of "button" tags.
"Input" tags should be used in forms instead of "button" tags because of browser incompatibilities.

  • Participants
  • Parent commits b5fcfa5

Comments (0)

Files changed (1)

File widgets/TbButton.php

 	const BUTTON_LINK = 'link';
 	const BUTTON_BUTTON = 'button';
 	const BUTTON_SUBMIT = 'submit';
+	const BUTTON_INPUTBUTTON = 'formButton';
+	const BUTTON_INPUTSUBMIT = 'formSubmit';
 	const BUTTON_SUBMITLINK = 'submitLink';
 	const BUTTON_RESET = 'reset';
 	const BUTTON_AJAXLINK = 'ajaxLink';
 				$this->htmlOptions['type'] = 'submit';
 				return CHtml::htmlButton($this->label, $this->htmlOptions);
 
+			case self::BUTTON_INPUTBUTTON:
+				return CHtml::button($this->label, $this->htmlOptions);
+
+			case self::BUTTON_INPUTSUBMIT:
+				$this->htmlOptions['type'] = 'submit';
+				return CHtml::button($this->label, $this->htmlOptions);
+				
 			case self::BUTTON_RESET:
 				$this->htmlOptions['type'] = 'reset';
 				return CHtml::htmlButton($this->label, $this->htmlOptions);