Hi I have started this code but i cant get it to work. new to javascript, but not sure how it works. im trying to make an alert for a text box "rrp" that alerts when it is less than the list price, therefore stopping an incorrect price being lodged.
here is what i have...
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<!-- Start of FORM -->
<form method="post" action="">
<script type="text/javascript">
function margin()
{
var LIST = document.getElementById("list").value
var RRP = document.getElementById("rrp").value
if(LIST>RRP)
{
alert("The list price is greater than the rrp")
}
</script>
<!--this list price is echo'd from database -->
<input type="text" name="list" value="10" id="list">
<!--this list price is echo'd from database -->
<input type="text" name="rrp" value="" id="rrp" onupdate="margin()">
<input type="submit" name="submit" value="submit">
</form>
<!-- End of FORM -->
</body>
</html>
remember im just a learner, just learnt a bit of php but would like to start writing in javascript