Welcome Guest, Not a member yet? Register   Sign In
can I call a javascript from within a controller ?
#1

[eluser]vickel[/eluser]
I'm creating a modalwindow with a javascript call. This modalwindow has a form submit button, which when clicked must:
close the modalwindow itself (javascript)
and execute a corresponding PHP form method post action "dosomething.php" (e.g. open a new view which echos "success")

what happens, when using from my view:

Code:
echo form_open('controller/dosomething);
...
$js='onClick="parent.mywindow.hide()"';
echo form_submit('my_submit_ID', 'click me!',$js);

is: the javascript is executed first (window is closed) but the form method post action "dosomething.php" is only executed, once I reopen the modalwindow

that is why I'd like to know if I can call the javascript from the controller :
I could first execute the javascript to close the modalwindow and as I'm allready in the controller "dosomething" anything like (echo "success") would be next...

thanks for any help


Messages In This Thread
can I call a javascript from within a controller ? - by El Forum - 01-23-2010, 08:39 PM
can I call a javascript from within a controller ? - by El Forum - 01-24-2010, 12:25 AM
can I call a javascript from within a controller ? - by El Forum - 01-24-2010, 12:45 AM
can I call a javascript from within a controller ? - by El Forum - 01-25-2010, 05:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB