Solved

Invalid 'for' loop control variable

Posted on 2001-06-23
3
3,666 Views
Last Modified: 2011-09-20
OK basically here is the scoop..



I have dumped a bunch of first names into an array. The array is named FiltUpArray

If I use this:

For Each val In FiltUpArray    
     
     If val = "Joe" Then

     Response.Write "That Name Exist In Your Array!"

      End If
Next
########################

It works pefectly... But.. If I use it as shown below in a form so that I can check the check boxes in the form it craps out with this error:

##########################
Microsoft VBScript compilation error '800a0410'

Invalid 'for' loop control variable

/filtersUpdate_hd.htm, line 156

For Each val in FiltUpArray
-------------^
##########################



############Code I use in HTML form##############
<input type="checkbox"
          <%
          For Each val In FiltUpArray    
            If val = "Acura" Then
          %>
            checked
          <%
            End If
           Next
          %>  
     
          name="Acura" value="ON">
###############################################

Any idea why?
0
Comment
Question by:muchowebdotcom
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
hongjun earned 200 total points
Comment Utility
Try this

<input type="checkbox"
<%
For Each val In FiltUpArray    
     If Cstr(val) = "Acura" Then
          Response.Write " checked "
                Exit For
    End If
Next
%>  
name="Acura">

hongjun
0
 
LVL 1

Author Comment

by:muchowebdotcom
Comment Utility
I just gave you the points because I already solved it another way.. Thanks and enjoy the points..
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Oh thanks anyway. Perhaps you just made a careless mistake and that's all. Your logic is there.

hongjun
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Reading Date Settings from Server 6 49
Using AJAX to call classic ASP function 4 68
Classic ASP + JS 4 67
API not working 33 47
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now