elepil
asked on
Form not submitting, can someone please tell me what I'm doing wrong?
The form somehow doesn't find the JavaScript function 'validateForm()', and I'm not sure why. Can someone please tell me what I'm doing wrong?
Thanks.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(function() {
function validateForm() {
alert("It got to validateForm()");
}
});
</script>
</head>
<body>
<form onsubmit="return validateForm();">
Home Phone:<br/>
<input type="text" id="txtHomePhone"/><p>
Work Phone:<br/>
<input type="text" id="txtWorkPhone"/><p>
<input type="submit" /><p>
</form>
</body>
</html>
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER