nemo
(Nemoneel)
September 30, 2011, 5:53pm
1
Hi,
I want to pass the form value using CHtml::submitButton and onclick. I try this way but can’t pass the value to the popup window
this value I want to pass
$model->User_id
Can you tell me where should i use this value to pass popup window?
?php echo CHtml::submitButton($model->isNewRecord ? 'Delete' : 'Save', array(
'name'=>'demandeVersement',
'onclick'=>"window.open ('/test/cgi-bin/test.pl', 'nom_interne_de_la_fenetre', config='height=500, width=700, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=yes, directories=yes, status=yes')"
));?>
BStep
(R Brad Stephens)
September 30, 2011, 8:12pm
2
I don’t think I understand what you’re trying to do. You’re going to have to be more specific about exactly what a user does on your form, where you’re passing this value from, and how you want it to be used on the “popup window”.
aruna470
(Aruna470)
October 1, 2011, 12:59am
3
//You can pass as get variable to popup window.Try below coding.
<?php echo CHtml::submitButton($model->isNewRecord ? 'Delete' : 'Save', array(
'name'=>'demandeVersement',
'onclick'=>"window.open ('/test/cgi-bin/test.pl?user_id='".$model->User_id."', 'nom_interne_de_la_fenetre', config='height=500, width=700, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=yes, directories=yes, status=yes')"
));?>
chleong
(Web Chleong)
October 1, 2011, 2:20am
4
Hi nemo,
I think you don’t need to use submitbutton in this page, you should use ajaxbutton() to pass values to controller and return on success to trigger window.open() with the return data
nemo
(Nemoneel)
October 1, 2011, 3:02am
5
Do you have any example code for Ajaxbutton?
nemo
(Nemoneel)
October 1, 2011, 3:11pm
6
//You can pass as get variable to popup window.Try below coding.
<?php echo CHtml::submitButton($model->isNewRecord ? 'Delete' : 'Save', array(
'name'=>'demandeVersement',
'onclick'=>"window.open ('/test/cgi-bin/test.pl?user_id='".$model->User_id."', 'nom_interne_de_la_fenetre', config='height=500, width=700, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=yes, directories=yes, status=yes')"
));?>
I tried your example but popup is not working.