troubleshooting Question

urgent! validation!

Avatar of justin_316_sr
justin_316_sr asked on
25 Comments1 Solution399 ViewsLast Modified:
scenario: validation for Lname, mname and fname before enabling the rest of the form...

this is my code for agree_process_0817.asp

server.scriptTimeOut = 99999

            Dim loConn, lrsPS, lsSQL,lsAction
            Dim lsAppdate, lsAppPos1, lsAppPos2, lsAppCareer, lsAppdavail, lsLname, lsFname, lsMname, lsNcrAdd,

            Dim lsNcrZip, lsNcrContact, lsNcrEmail, lsNcrFlag, lsProvFlag, lsProvAdd, lsProvCity, lsProv, lsZip, lsContactNo,

            Dim lsHeight, lsNationality, lsDob, lsAge, lsPob, lsGender, lsReligion, lsCivilStatus, lsChildren, lsLang, lsOrg,

lsProfExam, lsMajorSys
            Dim BPresentContract, BEmployee, BCourtCase, BCriminalCase

               Set loConn = server.createObject("ADODB.Connection")
            Set ls_AppInfo = server.createObject("ADODB.RecordSet")
            lsAction = request.querystring("action")
            lsModifiedRow = request.form("RandomNum")
            lsAppNumber = request.form("ModifyRecordAppNo")
            Response.Write (lsAction)
            if(lsModifiedRow = "") then
                  lsSQL = "SELECT * FROM hiring WHERE application_no ='" & lsAppNumber &"'"
            End if
            if(lsModifiedRow <> "") then
                  lsSQL = "SELECT * FROM hiring"
            End if
   lsSQL, loConn, 1, 3
                        lsAppNo = request.form("RandomNum")
                        lsAppdate = request.form("ApplicationDate")
                        lsAppPos1 = request.form("Rb_AppPos1")
                        lsAppPos2 = request.form("Rb_AppPos2")
                        lsAppCareer = request.form("tf_AppCareer")
                        lsAppdavail = request.form("tf_AppDavail")
                        lsLname = request.form("tf_Lname")
                        lsFname = request.form("tf_FName")
                        lsMname = request.form("tf_Mname")
                        lsNcrAdd = request.form("tf_NcrAdd")
                        lsNcrCity = request.form("tf_NcrCity")
                        lsNcrZip = request.form("tf_NcrZip")
                        lsNcrEmail = request.form ("tf_NcrEmail")
                        lsNcrContact = request.form("NcrContact")
                        lsProvFlag = request.form("Cb_ProvFlag")
                        lsProvAdd = request.form("tf_ProvAdd")
                        lsProvCity = request.form("tf_ProvCity")
                        lsProv = request.form("tf_prov")
                        lsZip = request.form("tf_Zip")
                        lsContactNo = request.form("tf_Contact")
                        lsWeight = request.form("tf_Weight")
                        lsHeight = request.form("tf_Height")
                        lsNationality = request.form("tf_Nationality")
                        lsDob = request.form("tf_Dob")
                        lsPob = request.form("tf_Pob")
                        lsAge = request.form("tf_Age")
                        lsGender = request.form("rb_sex")
                        lsReligion = request.form("tf_Religion")
                        lsCivilStatus = request.form("rb_status")
                        lsChildren = request.form("tf_Children")
                        lsLang = request.form("tf_Lang")
                        lsOrg = mid(request.form("tf_Org"), 1, 1000)
                        lsProfExam = mid(request.form("tf_ProfExam"), 1 , 600)
                        lsMajorSys = mid(request.form("tf_MajorSys"),1,2000)
                        BPresentContract = request.form("Rb_PresentContract")
                        BDbsoftEmployee = request.form("Rb_Employee")
                        BCourtCase = request.form("Rb_CourtCase")
                        BCriminalCase = request.form("Rb_CriminalCase")
'------------------------------------------Saving for Hiring and Skills---------------------------------------------
                  if (lsAppNumber= "") then
                  end if
                        if(lsAppdavail="") then lsAppdavail= null End if
                        ls_AppInfo("application_ncr_city")= lsNcrCity
                        ls_AppInfo("application_ncr_email")= lsNcrEmail
                        If lsProvFlag = "on" then lsProvFlag="1" else lsProvFlag = "0" End if
                        ls_AppInfo("application_prov_address")= lsProvAdd
                        if(lsDob="") then lsDob= null End if
                        if(lsAge="") then lsAge= null End if
                        ls_AppInfo("application_age")= lsAge
                        if(lsChildren="") then lsChildren= null End if
                        ls_AppInfo("application_prof_exam")= lsProfExam
                        ls_AppInfo("application_court_case") = BCourtCase
                        ls_AppInfo("application_criminal_record") = BCriminalCase
                        ls_AppInfo("application_employee") = BEmployee
                        ls_AppInfo("application_present_contract") = BPresentContract
        Set ls_AppInfo = nothing

after this code...i intend to place the following code for the validation of first, middle and last name..

        Dim lsLName, lsMName, lsFName
        Set ls_AppInfo = server.createObject("ADODB.Recordset")
        lsSQL = "SELECT * FROM hiring WHERE FName = '"&request.form("tf_FName")&"' AND LName =

'"&request.form("tf_LName")&"' AND MName =          
          '"&request.form("tf_MName")&"' lsSQL, loConn, 1, 3
          if (!(ls_AppInfo.EOF) then
                document.write("You have already registered!")
                End if
         Set ls_AppInfo = nothing

what i want to accomplish is this...

a. when user loads the page..all the fields are disable except for FIRST NAME, MIDDLE NAME, LAST NAME, and the VALIDATE


b. when user leaves the 3 fields blank..and clicks validate, an alert will be displayed..(i've done this part)

c. when user leaves one or two fields blank, and clicks validate, the alert will again be displayed..(i've done this part)

d. when the user completes the 3 fields correctly, and clicks validate..processing will occur in the agree_process_0818.asp to

check if the user has already registered or not..

e. note: anne monique morrie is different from anne marie morrie..and so there should be no error on this part..

f. when the first, middle and last name exist in the should return an alert saying he/she has already registered..

g. when the first, middle and last name does not exist yet in the database, it should be able to enable the rest of the fields

which were disabled upon load of the page..

h. note: the agree button will also use agree_process_0818.asp for the processing...(this is working already)

<form name = "App_Form" method="post" action="application_form_0818.asp?action=reload">

<font face="Arial"><input type="submit" name="validate" value="Validate" class="subbuttonctl"></font>

<input type="button" id="agree" name="Save" value="Agree" class="subbuttonctl" onClick="ufAgree()">

function ufAgree()
       var checking = true;
       checking = (checking==true) ? ufCheckDate() : checking
       checking = (checking==true) ? ufCheckBirthDate() : checking
       checking = (checking==true) ? ufCheckEmail() : checking
       checking = (checking==true) ? ufcheckRadio() : checking
      checking = (checking==true) ? ufcheckAddress() : checking

       if (checking==true)
       if (document.App_Form.ModifyRecordAppNo.value=="")
              document.App_Form.RandomNum.value = GetRandomNumber();
                    var ModifyRecord
                    document.App_Form.RandomNum.value = ""


please help me..this is really urgent! please!! thank you!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 25 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 25 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros