Jump to content
Killersites Forums

marius123

New Members
  • Posts

    1
  • Joined

  • Last visited

marius123's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I have created the following html page in Dreamweaver. When the user enter an age >39 the webpage must load else the alert message must be displayed. What am I doing wrong? <!DOCTYPE html> <html> <body> <h2>HTML Forms</h2> <form action="" onSubmit="myFunction()"> <label for="fname">First name:</label><br> <input type="text" id="fname" name="fname" value=""><br> <label for="lname">Last name:</label><br> <input type="text" id="lname" name="lname" value=""><br><br> <input type="submit" value="Submit"> </form> <script type="text/javascript"> function myFunction(){ var fname = document.getElementById("fname").value; if(fname > 39) { loadPage('http://www.mdrtrust.co.za');>Home<div> } else alert("Condition Not met") } </script>
×
×
  • Create New...