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 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? 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>"; 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. 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
Archived
This topic is now archived and is closed to further replies.