Results 1 to 2 of 2

Thread: Variable

  1. #1
    Join Date
    Dec 1969

    Default Variable

    is there a specific syntax to use a variable in an IF function???<BR><BR>For some reason the code below does not work but if I replace the variable with a number it works fine<BR><BR>&#060;option value=&#060;%=(ds_color.Fields.Item("OptionID").Va lue)%&#062;<BR>&#060;% if ds_color.Fields.Item("OptionID").Value = image1color then<BR>response.write(" selected")<BR>end if %&#062; &#062;<BR><BR>I also know that the variable is wloaded because it displays the value when I write it on it&#039;s own<BR><BR>&#060;%= image1color %&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Variable

    if the OptionId field is an int you could be having a casting problem. try comparing strings.<BR>ds_color.Fields.Item("OptionID").Value & "" = image1color & ""

Posting Permissions

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