catching empty variables

Results 1 to 4 of 4

Thread: catching empty variables

  1. #1
    Join Date
    Dec 1969

    Default catching empty variables

    I can&#039;t work out how to do this. I have a form that sends its variables to an asp page which puts them into a database. I want to allow empty variables, but I&#039;d like to lable some of them myself (eg. if name="", then name="anon" or something) <BR><BR>Can&#039;t find an easy answer to this. Is there any way of allowing null variables and relabelling some of them? <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: catching empty variables

    Why doesn&#039;t what you&#039;re trying work? Looks pretty straightforward.

  3. #3
    RDM Guest

    Default Should already do this...

    ...Trim(Request("txtMYTEXTBOX")) should return blank if the textbox is not part of the form collection of elements. Simply populate a variable with it&#039;s contents and then reset the variable to whatever your defaults are...<BR><BR>Did I miss something more complicated in your question?

  4. #4
    Bill H. Guest

    Default RE: catching empty variables

    I always try to look for both empty and null. Seems redundant, but it&#039;s for peace of mind.<BR><BR>If isNull(name) OR len(trim(name)) = 0 Then<BR> name="anon"<BR>End If<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