This one has me stumped and I hope someone knows the answer.
I am reading a number of records from a database and building up a list of products on an ASP Page.
As the code that generates each line of the list is in a Server Side loop I am naming each field using the ID of the record from the database:
IE:
<Input type "Checkbox" name="Instock1">
<Input type "Checkbox" name="Instock2">
<Input type "Checkbox" name="Instock3">
I have a link on each line that calls a client side VBScript function to dynamically check this box. It passes the ID to the function so it knows which one to check.
A part of my function looks like this
Function CheckBox(intRecordID)
strObjectName="InStock" & intRecordID
...
End Function
So I have a variable that contains the name of the object I want to check but the line:
frm.strObjectName=Checked
doesn't work.
How do I tell the browser to look at the object whose name is contained within the string strObjectName?
I've looked everywhere for some kind of conversion/eval function but with no success.
Anyone know how to do it?
Paul Garden
I am reading a number of records from a database and building up a list of products on an ASP Page.
As the code that generates each line of the list is in a Server Side loop I am naming each field using the ID of the record from the database:
IE:
<Input type "Checkbox" name="Instock1">
<Input type "Checkbox" name="Instock2">
<Input type "Checkbox" name="Instock3">
I have a link on each line that calls a client side VBScript function to dynamically check this box. It passes the ID to the function so it knows which one to check.
A part of my function looks like this
Function CheckBox(intRecordID)
strObjectName="InStock" & intRecordID
...
End Function
So I have a variable that contains the name of the object I want to check but the line:
frm.strObjectName=Checked
doesn't work.
How do I tell the browser to look at the object whose name is contained within the string strObjectName?
I've looked everywhere for some kind of conversion/eval function but with no success.
Anyone know how to do it?
Paul Garden