ok, i made an example code to help me get an understanding. Looks ok, except for one problem. When the user hits submit, the form should do its post. I want to get at the textfield only when the user trys to go to a different page.
This is wht i have so far:
HTML Code:
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript">
<!--
function convertText() {
var x = document.SampleForm.myText.value;
if(x == ""){
alert("Nothin");
}else{
confirm("Unsaved Data");
}
}
-->
</script>
</head>
<body onunload="convertText()">
<form name="SampleForm" action="abc.php">
<input type="text" name="myText">
<input type="submit" value="Convert" >
</form>
</body>
</html>
any help would be great.
Rgds,
Kris
Bookmarks