Siddhartha Posted September 6, 2010 Share Posted September 6, 2010 Hi all, I want to call a javascript function from a php function like this: public function Buscar() { $HoraInicio = $_POST['edtHoraInicio']; $HoraFin = $_POST['edtHoraFin']; $FechaInicio = $_POST['edtFec1']; $FechaFin = $_POST['edtFec2']; $FechaMax = $FechaFin." ".$HoraFin.":00"; $FechaMin = $FechaInicio." ".$HoraInicio.":00"; $_GET["FechaMax"] = $FechaMax; $_GET["FechaMin"] = $FechaMin; echo $FechaMin; echo "<script language=javascript>alert('Hi.')</script>"; } but the function Buscar never show the alert but shows the $FechaMin I hopu u guys can help me out with this probem Thanks, Siddhartha Quote Link to comment https://forums.phpfreaks.com/topic/212641-call-javascript-function-from-php-function/ Share on other sites More sharing options...
Adam Posted September 6, 2010 Share Posted September 6, 2010 It works for me. If you comment out the echo $FechaMin; line, does it work then? Quote Link to comment https://forums.phpfreaks.com/topic/212641-call-javascript-function-from-php-function/#findComment-1107779 Share on other sites More sharing options...
Siddhartha Posted September 6, 2010 Author Share Posted September 6, 2010 This line works: echo $FechaMin; but this line doestn work: echo "<script language=javascript>alert('Hi.')</script>"; Quote Link to comment https://forums.phpfreaks.com/topic/212641-call-javascript-function-from-php-function/#findComment-1107882 Share on other sites More sharing options...
Adam Posted September 6, 2010 Share Posted September 6, 2010 I know, I'm thinking though something that $FechaMin echoes out could be the problem. Quote Link to comment https://forums.phpfreaks.com/topic/212641-call-javascript-function-from-php-function/#findComment-1107885 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.