See the simple test program below. In the alert, I need to display the variable MaxPrice with two decimals. I've place $Maxprice in the test program, but in reality, $MaxPrice is read from a SQL file and is a numeric field with a numeric value (in this case 2.00). The alert is displaying only "2". How do I get it to display "2.00"?
<html> <head> <script language="javascript"> function myFunction() { PriceEntered=document.forms["form1"]["Price"].value; MaxPrice=document.forms["form1"]["MaxPrice"].value; alert("Price Entered=" + PriceEntered + " and maximum= " + MaxPrice ); } </script> </head> <?php $MaxPrice=2.00; ?> <body> <form id="form1" name="form1" method="post" onsubmit="myFunction ()" action="test.php"> <input name="MaxPrice" id="MaxPrice" type="hidden" value="<?php echo $MaxPrice;?>"> <input name="Price" id="Price" type="text" value="3.00"> <input type="submit" name="submit1" value"Submit" /> </form> </body>