Hi all,
I am trying to put a confirmation alert so that before saving a form, user will be asked "Are you sure you want to save?" How is this done on the create action in the controller?
Any help will be appreciated. Thanks
Hi all,
I am trying to put a confirmation alert so that before saving a form, user will be asked "Are you sure you want to save?" How is this done on the create action in the controller?
Any help will be appreciated. Thanks
CHtml::submitButton('Save', array('confirm'=>'Are you sure you want to save?'));
[font=“Verdana, Arial, Helvetica, sans-serif”]Look at $htmlOptions of CHtml::Button. I think passing a little javascript there like: var a = confirm(‘Are you sure?’); if (a) this.submit(); [/font][font=Verdana, Arial, Helvetica, sans-serif]would do it[/font]
Ignore my post, andy’s answer seems like a better approach
Nice One Andy_s…