Hello there,
I’ve got a big form which is needed in several screens. So I thought it would be a good idea to put it in a widget to reuse/maintain it easily.
The problem I have is that I don’t want to put the submit button of this form in the widget. The submit button is in a wizard (“Next>>” button) and if I put this inside the widget it’s not flexible (maybe I want a maintenance screen with a “Save” button and pass different GET parameter, or maybe I just want to put this button somewhere else on the screen).
The name of the widget’s form is details-form. I’ve tried something like this in the view that uses the widget:
<script>
jQuery('body').undelegate('#yta','click').delegate('#yta','click',function(){
var formToSubmit = document.getElementById('details-form');
jQuery.yii.submitForm(formToSubmit,'/website/client/registration',{});return false;}
);
</script>
and the button is
echo CHtml::button('Next >>', array('id' => 'yta', 'type' => 'submit'));
When I click the button the action is properly triggered but the POST variable is empty…
Any idea ? Am I in the right direction or is there a easier way to do it?
Cheers
Renaud