Hi guys
Just wondering if it is possible to call a confirmation message in a controller action?
I know that you can do this:
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',
array('confirm'=> 'Are you Sure')); ?>
However in my app, the user selects from a dropdown and then clicks the submit button. The dropdown list contains a list of states and the action has to compare the selected state against the current state, so the confirmation message should change depending on the state.
Lets says the current state is “Application Received” (which would also be the selected option in the dropdown list), the user could select “Application Approved”, which means that lots of other things will be updated. So I want the user to be sure of what they are doing. Clicking ‘Confirm’ on the dialog should update the current state to the selected state and whatever else needs to be done.
I just need to know how to get that dialog to appear when the action is called.
If you need any code, just let me know.
Any help would be great!