Monday, 27 May 2013

HTML5 not calling javascript function

HTML5 not calling javascript function

For some reason that I cannot fathom, the following code does not work:
<!DOCTYPE html>
<html>
<head>
<title>Devit Ajax Test</title>
<script language="JavaScript" type="text/javascript" src="js/voucher.js"></script>
</head>
<body onLoad="document.VU.cellNo.focus()">
<form name="VU" id="VU" method="post" >
    <div class="FormItem">
        <label>Cell Number:</label>
        <input type="tel" id="cellNo" name="cellNo" required >
    </div>
    <p>
    <div class="FormItem">
        <label>PIN:</label>
        <input id="pin" name="pin" type="text" required >
    </div>
    <div class="FormItem">
        <p>
        <input type="submit" value="Submit" onclick="submit_click()">
        </p> 
    </div>
<center>
<div id="loadingNode"></div>
</center>
</body>
</html>
<script>
function submit_click()
{
    alert("progExe()");
    progExe("http://web.devit.co.za/PEMObi/Pages/HomePage/Homepage.aspx?CellNumber="+VU.cellNo.value"&PIN="+VU.pin.value);   
}
</script>
The submit_click() function never gets called despite the onclick call.

No comments:

Post a Comment