Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically clicking check boxes

Status
Not open for further replies.

ducky62

Programmer
Jul 10, 2001
24
CA
i have
dim temp, temp2
for i 1 to num
temp=""
temp2=""
temp=temp&"1st"&i
temp2="document.forms.form."&replace(temp," ","")&".checked=true"
response.write(temp2)
temp2.execute
next

where 1st1, 1st2,... are checkboxes in a form named form

but when I run this I get the error
object required "document.forms.form"

any help on the subject would be greatly appreciated...
 
OK I am not really sure where you are trying to run this code. You have your variable dimmed so I am assuming that you are doing it on the server??? Which will not work for a form because the form is created with the html that is done on the client. So the reason you are getting the error is there is no form object. If you want the server to dynamically check boxes for you then you need to do something like this.

<form>
<input type=checkbox name=box1 <%if (your condition) then response.write(&quot;checked&quot;)%>...

this way if your condition is met the box will be checked.

If you mean to do this on the client you should be using javascript. Let me know if you have any questions.

Roj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top