how do i check text from a text box that is in mixed case?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Ginsherman

    #1

    how do i check text from a text box that is in mixed case?

    I need the following to check if the user entered the word:
    (the following is a snippet of the full scritp)

    Code:
    'Verifies repairStatus is one of valid status.
    		if repairStatus<>ucase("new") AND repairStatus<>ucase("repaired") AND repairStatus<>ucase("completed") then
    			errorString=errorString + "Invalid status.<br/>"
    		end if
    for example, if the user typed 'New' I would not see the error
  • danp129
    Recognized Expert Contributor
    • Jul 2006
    • 323

    #2
    Not sure I understand you but here's how I would code it if I'm understanding what you are doing..
    Code:
            ' set repairStats variable to UPPER CASE version of what user submitted 
            '(Replace "Form" with "Querystring" if form method is GET)
            repairStatus = UCase(Request.Form("status"))
            If repairStatus <> "NEW" And repairStatus <> "REPAIRED" And repairStatus <> "COMPLETED" Then errorString = errorString & "Invalid status.<br/>"

    Comment

    Working...