11-06-2009, 09:00 PM
This code submits the form when the user presses the <div>
Code:
<html>
<head>
<script language="javascript" type="text/javascript">
function submitForm() {
document.myForm.submit();
}
</script>
</head>
<body>
<form name="myForm" action="index.php" method="post">
<textarea onkeyup="editText(this);"></textarea>
<input type="submit" name="Submit" value="Submit" />
</form>
<div onmouseup="submitForm();">Submit with JavaScript</div>
</body>
</html>