Changing the case from a form input

Results 1 to 3 of 3

Thread: Changing the case from a form input

  1. #1
    Bill Bolte Guest

    Default Changing the case from a form input

    I&#039;m new to asp and can&#039;t quite figure this out. How do I change the case of an input from a form field before it&#039;s sent to the database? This is for a login page and I want it the variable to change to all lowercase. Following is the asp script I&#039;m using - the variable in question is "userID".<BR><BR>&#060;% <BR><BR>Dim dsnSrg<BR>Dim userId<BR>Dim password<BR>Dim loginSql<BR>Dim loginRs<BR>Dim connLogin<BR>Dim logRs<BR>Dim logSql<BR>Dim company<BR><BR>sub killObject()<BR><BR> connLogin.Close<BR> Set connLogin = Nothing<BR><BR>end sub<BR><BR> dsnSrg = "lowen-furn"<BR><BR> Set connLogin = Server.CreateObject("ADODB.connection")<BR> If Not IsObject(connLogin) Then<BR> Response.Write "Database is temporarily unavailable"<BR> Response.End<BR> End If<BR> <BR> connLogin.Open (dsnSrg) <BR> <BR> &#039;On Error Resume Next <BR> <BR> company = Request.Form("company")<BR> company = replace(Request.Form("company"),"&#039;","")<BR> userID = Request.Form("uid")<BR> <BR> &#039; session variable<BR> Session("company") = Request.Form("company")<BR> <BR> logSql = "INSERT INTO user_log (log_uid, log_pw) VALUES (&#039;" & userID & "&#039;,&#039;" & company &"&#039;)"<BR> Set logRs = connLogin.Execute(logSql)<BR> <BR><BR> loginSql = "SELECT * FROM login WHERE userID = &#039;" & userID & "&#039;"<BR> Set loginRs = connLogin.Execute(loginSql)<BR> <BR> <BR> If loginRs.BOF Then<BR> Response.Redirect "login_invalid.html"<BR> killObject()<BR> Response.End<BR> End If<BR> <BR> <BR> If loginRs.Fields("userID") = userID Then<BR> Session("Authorization") = "true"<BR> Response.Redirect "main/index.asp"<BR> Else<BR> Response.Redirect "login_invalid.html"<BR> killObject()<BR> Response.End <BR> End If<BR> <BR>killObject()<BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Changing the case from a form input

    Just use userID = LCASE(Request.Form("uid"))

  3. #3
    Join Date
    Dec 1969

    Default RE: Changing the case from a form input


Posting Permissions

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