.EOF question

Results 1 to 2 of 2

Thread: .EOF question

  1. #1
    Join Date
    Dec 1969

    Default .EOF question

    Hello everyone and thanks much for your past help.<BR><BR>I am working on a form that allows visitors to update their personal information in a SQL database and I want to validate the data in the form at the same time.<BR><BR>I have everything set up, but if I delete all data in the form in the hopes of having error messages return to the page, I get the message "Either BOF or EOF is true. The operation requires a current record" after I submit the form.<BR><BR>While I understand that you must have a current record, what would be the easiest way to validate the data in the form if the visitor decides to delete the data and attempt to update the database with empty fields? I need to come back to the form page with an error message instead of the VBScript error showing up in the browser.<BR><BR>Any help would be appreciated. Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: .EOF question

    if request.form("isSubmitted") = "Yes" then <BR>FN = request.form("FirstName")<BR>...<BR>....<BR>.....< BR>if FN = "" then<BR>ErrorMessage1 = "Please insert A First Name."<BR>end if<BR>.....<BR>......<BR><BR>If ErrorMessage1 = "" AND ErrorMessage2 = "" .. ... ... THEN<BR>update record else repsonse.wtire the appropriate errors.... <BR><BR><BR>or use javascript like so:<BR><BR>&#060;script language="JavaScript"&#062;<BR><BR>function form_validator(theForm)<BR>{<BR><BR> if(theForm.FirstName.value == "") {<BR> alert("Please enter your First Name!");<BR> theForm.FirstName.focus();<BR> return(false);<BR> }<BR> <BR> if(theForm.LastName.value == "") {<BR> alert("Please enter your Last Name");<BR> theForm.LastName.focus();<BR> return(false);<BR> }<BR><BR> if(theForm.cuid.value == "") {<BR> alert("Please enter your CUID!");<BR> theForm.cuid.focus();<BR> return(false);<BR> }<BR> <BR> if(theForm.confirmcuid.value == "") {<BR> alert("Please enter your cuid confirmation!");<BR> theForm.confirmcuid.focus();<BR> return(false);<BR><BR> }<BR><BR> <BR> if(theForm.cuid.value != theForm.confirmcuid.value ) {<BR> alert("Please be sure of your CUID!");<BR> theForm.confirmcuid.focus();<BR> return(false);<BR> }<BR> <BR>}<BR>&#060;/script&#062;<BR>&#060;META NAME="GENERATOR" Content="Microsoft FrontPage 4.0"&#062;<BR>&#060;/HEAD&#062;<BR><BR><BR>&#060;form action="answer.asp" onSubmit="return form_validator(this)" method="post" name="theForm"&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts