Validation problem

Results 1 to 3 of 3

Thread: Validation problem

  1. #1
    Little Imp Guest

    Default Validation problem

    I am trying to validate my asp page so that data is entered into my database correctly. I am performing checks via functions and should any function fail then the data is not submitted to the database but instead redirected to a similar page in order for the corrections to be done and then for the checks to be repeated.<BR><BR>On the submit button the code calls the OnValidate() function seen below: -<BR><BR>function OnValidate()<BR> {<BR> var submit = 0;<BR> <BR> if(window.document.submitform.productversion.value == "Invalid")<BR> {<BR> submit = 1;<BR> }<BR> if(window.document.submitform.applicationarea.valu e == "Unassigned")<BR> {<BR> submit = 1;<BR> }<BR> if(window.document.submitform.username.value == "")<BR> {<BR> submit = 1;<BR> }<BR> if(window.document.submitform.usertelephone.value == "")<BR> {<BR> submit = 1;<BR> }<BR> if(!validemail(window.document.submitform.useremai l.value))<BR> {<BR> submit = 1;<BR> }<BR> if(!validdate(window.document.submitform.daterecei ved.value))<BR> {<BR> submit = 1;<BR> }<BR> <BR> if(submit = 0)<BR> {<BR> alert("Submit")<BR> OnSubmit()<BR> }<BR> else<BR> {<BR> alert("Redirect")<BR> ReDirect()<BR> }<BR><BR><BR>I know this is called properly as I get the alert "Redirect". The problem I am having is that I am trying to port the data onto the redirect script but not all of it is being shown. <BR><BR>I have done the following in order to obtain the information: -<BR><BR>Dim RequestType <BR> Dim ProductName<BR> Dim ProductVersion<BR> Dim Summary<BR> Dim Severity<BR> Dim Frequency<BR> Dim Description<BR> Dim UserName<BR> Dim UserEmail<BR> Dim UserTel<BR> Dim UserFAX<BR> Dim MyDate<BR> Dim MyTime<BR> Dim DateReceived<BR> Dim Area<BR> <BR> &#039; Grab the variables from the first page for modification using querystring<BR> RequestType=Request.QueryString("request")<BR> ProductName=Request.QueryString("productname")<BR> ProductVersion=Request.QueryString("productversion ")<BR> Summary=Request.QueryString("summary")<BR> Severity=Request.QueryString("severity")<BR> Frequency=Request.QueryString("occurrence")<BR> Description=Request.QueryString("description")<BR> UserName=Request.QueryString("username")<BR> UserEmail=Request.QueryString("useremail")<BR> UserTel=Request.QueryString("usertelephone")<BR> UserFax=Request.QueryString("userfax")<BR> MyDate=Request.QueryString("mydate")<BR> MyTime=Request.QueryString("mytime")<BR> DateReceived=Request.QueryString("datereceived")<B R> Area=Request.QueryString("applicationarea")<BR><BR >Now, some of this works as I have managed to force the data that appears in pulldown selects to default to the users choice. The problem is where text/dates/numbers has been written in a text box and I then try and get the value to appear.<BR><BR>For example: <BR>&#060;input type="text" value=MyDate name="mydate" size="20"&#062; <BR><BR>Instead of getting the value of MyDate I get the text "MyDate" appearing.<BR><BR>Can anyone help Little Imp on this task he would be most grateful

  2. #2
    Join Date
    Dec 1969

    Default RE: Validation problem

    &#060;input type="text" value="&#060;%= myDate %&#062;" /&#062;<BR><BR>basic ASP - a fundamental error there I feel.

  3. #3
    Little Imp Guest

    Default RE: Validation problem

    Little Imp appreciates its a fundamental error but then again Little Imp is an Imp and not an ASP programmer.<BR><BR>Little Imp grants you one wish for your efforts and wishes you a good day!

Posting Permissions

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