Change your FORM tag to be <FORM METHOD=post ACTION=paper.asp> and
change your submit button to be <INPUT TYPE=BUTTON value='SAVE'
onclick='EvaluateValues()'> instead. You will also need to change the
Javascript as follows:
<script type="text/javascript">
function EvaluateValues(){
if (TestValues() == true) {
document.forms[0].submit();
}
}
</script>
Because your Javascript is doing a navigate using
document.location.href, the form data is never posted when the page
navigates. By using the document.forms[0].submit() it will post the
form data, and the <FORM ..> tag will tell it where to post the data
to.
jo*********@ofir.dk (J?rgen Jensen) wrote in message news:<e3**************************@posting.google. com>...
I have made an asp-page. When pressing Submit, the form loads a
javascript, for evaluating the input values. The asp-page is being
reloaded from the javascript, to save the input-values.
The evaluation-script is running fine, but when the ASP-script has to
save the value in txtFolder, the record is being added, but the saved
value from input 'Folder' is empty.
The tFolder-value is used when the ASP-page is loading values to edit
existing records.
<%
' ASP script
rs.fields("Folder").value = Trim(Request.Form("txtFolder"))
%>
<script type="text/javascript">
function EvaluateValues(ASPFile){
if (TestValues() == true) {
document.location.href=ASPFile;
}
}
</script>
<form name="MyForm" method="Post"
action="javascript:EvaluateValues('Paper.asp?mode= Add')">
<input type="text" value="<%=tFolder%>" maxlength="1" name="txtFolder"
size="1">
<input type="submit" value="Save" name="B1"></form>
But where does the link break.
I hope you can see my problem. No values are being saved.
Thanks
Jorgen