Forums
This topic is locked
ASP form Validation with Asp Upload 3
Posted 24 May 2007 13:51:21
1
has voted
24 May 2007 13:51:21 Andrew Wiggins posted:
I am trying to add form validation on fields other than the 'file' field. The validation works and prevents the record insert but the file upload still goes ahead!I have added the validation within the MM_editAction code so:
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (UploadQueryString <> "" Then
If (CStr(UploadFormRequest("MM_insert") = "form1" Then
If UploadFormRequest("fieldName" = "" Then
Response.Redirect("Error.asp"
End IF
End IF
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(UploadQueryString)
End If
However, this cannot be the right place as the file upload still executes!
Any pointers to where I am going wrong would be most helpful, it would be a shame to have to split the form into 2, data entry and then file upload.
TIA
Andrew