Jump to content

[SOLVED] Javascript Nested in Php?


ballhogjoni

Recommended Posts

Can someone help me with this? For some reason the javascript button is not showing when you run this in IE.

 

echo "<a href=\"leads.php\">Back to Fresh Leads</a>";
echo "<div align=\"center\">";
echo "<script language=\"Javascript1.2\">";
echo "var message = \"Print this Lead\";";
echo "function printpage() { window.print(); }";
echo "document.write(<form><input type=button  +value=\"+message+\" onClick=\"printpage()\"></form>);";
echo "</script>";
echo "</div>";

Link to comment
https://forums.phpfreaks.com/topic/50655-solved-javascript-nested-in-php/
Share on other sites

echo "<a href=\"leads.php\">Back to Fresh Leads</a>";
echo "<div align=\"center\">";
echo "<script language=\"Javascript1.2\">";
echo "var message = \"Print this Lead\";";
echo "function printpage() { window.print(); }";
echo "document.write('<form><input type=\"button\"  value=\"' + message + '\" onClick=\"printpage()\"></form>');";
echo "</script>";
echo "</div>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.