Maintain entered data
I'm trying to add a new record into a table of a database, and that is no problem, but when it goes to add the new value in the database it clears all the info for the page before that. I was wondering if there might be a way I could submit the record on the same page and reload just the lists, or maybe recall all the info from the previous page (addnewPOP.asp)into the loaded page (addeffort.asp) and just skip the reload to addnew.asp
addnewPOP.asp
...
...
<form method=post action="addeffort.asp" id=form2 name=addneweffort>
<INPUT name=addneweffort ID="Text3" >
<input type=submit value=Add id=submit1 name=submit1>
</form></TD></TR>
addeffort.asp
<%
Dim objRS, bolFound
Set objRS = Server.CreateObject ("ADODB.Recordset")
objRS.Open "Effort", objConn, , 3, 2
%>
<%
bolFound = True
If (Request.Form("addneweffort") = "")Then
bolFound = False
Response.Write "<a href='addnew.asp'>You must enter the data for: Effort.<p></a>"
End If
If bolFound = True then
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "effort", objConn, , 3, 2
objRS.AddNew
objRS("effort") = Request.Form("addneweffort")
objRS.Update
objConn.Close
Set objConn = Nothing
End If
Response.Write "<input name=hidform type=hidden value='" & Request.Form("hidform") & "'>"
%>
<script language="javascript">
<!--
location.replace("addnew.asp");
-->
</script>
|