Set onsubmit within form tab, the example I have tested and work.
<html>
<head>
<script>
function runAlert()
{
var path ="http://www.jup.com/img.jpg";
alert(path);
}
</script>
</head>
<body>
<form action="test.php" method="post" onSubmit="return runAlert()">
<input type=submit >
</form>
</body>
</html>
Run Javascript first, then will submit the form.
Reference: http://www.codingforums.com/showthread.php?t=126690
No comments :
Post a Comment