I'm having some problem with my validation. The page that I'm doing the validation on is a page where I add a new line to the table in the database. I enter in a date field so I want to make sure that they are entering in a valid date. I use the following code:
Sub thisPage_onenter()
if (thisPage.firstEntered) then
Recordset1.addRecord()
end if
end Sub
Sub btnSubmit_onclick()
dim errmsg
OktoProcess=false
if txtDate.value <> "" and IsDate(txtDate.value) = false then
errmsg = "Quote Due Date is a date field. Please enter the date in the format mm/dd/yyyy"
else if txtProjDate.value <> "" and IsDate (txtProjDate.value) = false then
errmsg = "Project Start Date is a date field. Please enter the date in the format mm/dd/yyyy"
else
OktoProcess = true
end if
end if
if (OktoProcess=false) then
Response.Write "<font size=4 color=red>" & errmsg & "</font>"
else
Recordset1.updateRecord
Response.Redirect ("MainMenu.asp"
end if
End Sub
I have this exact same code in another web application and it works just fine. However, with this one it seems to forget about the adding a new line and just updates the first line in the table. If I enter in a correct date and it skips having the output an error message, it works fine. Does anyone know why this might be doing this? Any help would be appreciated.
Thanks.
Sub thisPage_onenter()
if (thisPage.firstEntered) then
Recordset1.addRecord()
end if
end Sub
Sub btnSubmit_onclick()
dim errmsg
OktoProcess=false
if txtDate.value <> "" and IsDate(txtDate.value) = false then
errmsg = "Quote Due Date is a date field. Please enter the date in the format mm/dd/yyyy"
else if txtProjDate.value <> "" and IsDate (txtProjDate.value) = false then
errmsg = "Project Start Date is a date field. Please enter the date in the format mm/dd/yyyy"
else
OktoProcess = true
end if
end if
if (OktoProcess=false) then
Response.Write "<font size=4 color=red>" & errmsg & "</font>"
else
Recordset1.updateRecord
Response.Redirect ("MainMenu.asp"
end if
End Sub
I have this exact same code in another web application and it works just fine. However, with this one it seems to forget about the adding a new line and just updates the first line in the table. If I enter in a correct date and it skips having the output an error message, it works fine. Does anyone know why this might be doing this? Any help would be appreciated.
Thanks.