Click to See Complete Forum and Search --> : Form won't submit after cancelled prompts


N47H4N
10-18-2003, 02:34 PM
Desired behaviour:
1. User clicks link answers prompts then hidden form submits
AND
1. user clicks link and cancels prompts, hidden form does NOT submit
2. User clicks link answers prompts then hidden form submits

Current behaviour:
1. immediately after page load or page refresh: user clicks link answers prompts then hidden form submits
AND
1. user clicks link and cancels prompts, hidden form does NOT submit
2. User clicks link answers prompts then hidden form STILL DOES NOT submit, but I do receive the correct debugging alerts!


Here is the page code (what am I missing?):

<html>
<title>Document Direct - Budget Variances - CDM</title>
<head>
<script language="JavaScript">
function submituwhDocDirectLink1066400599623(){
with(document.uwhDocDirectLink1066400599623){
recipientID.value = "xxx";
password.value = "xxx";
rptID = "CDM";
suffix = prompt("Please enter a 4 digit department id. (example: 1020)","");
while(suffix == "" || isNaN(suffix) ){
alert("You did not enter the required 4 numeric digits, please try again.");
suffix = prompt("Please enter a 4 digit department id. (example: 1020)","");
}
reportID.value = rptID + suffix;
if(suffix == null){
alert("returning false");
return false;
}else{
alert("submitting");
submit();
}
}
}
</script>
</head>

<body >
<form name="uwhDocDirectLink1066400599623" action="https://xyz/bin/ddicgi.EXE" method="POST" >
<input type="Hidden" name="recipientID">
<input type="Hidden" name="password">
<input type="Hidden" name="reportID">
</form>
Select the following link if Document Direct fails to load...<br>
<a href="JavaScript:void(null);" onclick="submituwhDocDirectLink1066400599623()" class="standard">Budget Variances - CDM&nbsp;&raquo;</a>

</body>
</html>