birdmant wrote:
> Jeff Thies wrote:
>
>>*birdmant wrote:
>>
>>>I am running a query to return product codes and would like to
>>
>>creata a
>>
>>>checkbox for each row returned. I would like to give the checkbox
>>
>>a
>>
>>>name using this code so that I can identify it. I'm moving the
>>
>>product
>>
>>>code to an array but am not successful in setting the name to the
>>
>>code
>>
>>>value. I've tried arrays and variables to no avail.
>>>
>>>Is there a way to do this? This is the piece of code I'm using.
>>>
>>>while (!rs.EOF)
>>>{
>>>a[x] = rs.Fields("PROD_CD");
>>>Response.Write("<input type='checkbox' name=a[x] checked
>>>onclick='clickbox(this)'>");
>>>Response.Write("<br>");
>>>rs.MoveNext();
>>>x++;
>>>}
>>
>>I'm not ASP guy but doesn't that print a[x] instead of the value. .
>>
>>You'll want to quote the attribute if it contains spaces and make
>>theres
>>characters it can't start with like digits (I think).
>>
>>I would do something like this:
>>
>>Response.Write("<input type='checkbox' name=checkbox_'" + a[x] + "'
>>checked onclick='clickbox(this)'>");
>>
>>Iterate through the form collection and look for fields starting
>>with
>>checkbox_ , and extract the field name.
>>
>>That may be bad ASP. I don't know how you guys can use ASP, what it
>>can't do drives me crazy!
>>
>>PROD_CD is unique isn't it?
>>
>>Jeff
>>
>>
>>>
>>>Any help would be greatly appreciated.
>>>
>>>Tom
>>>
>>>
>>>
>>>--
>>>birdmant
>>>
>>
>>------------------------------------------------------------------------
>>
>>>Posted via http://www.forum4designers.com
>>>
>>
>>------------------------------------------------------------------------
>>
>>>View this thread:
>>
>>http://www.forum4designers.com/message109289.html
>>
>>>*
>
>
> Jeff,
>
> Thanks for the reply. When I do this the name becomes:
>
> checkbox_ +a[x] +
Change my +'s to &'s. Didn't I mention I'm not an ASP guy?
This is basic ASP stuff. Take a look at an ASP FAQ like:
<URL:
http://www.aspfaqs.com/aspfaqs/ >
Also, stop using the Designers Forum. Find out how to set up usenet on
your mail client. Microsoft has a free usenet server:
news.microsoft.com. Set that up and ask in a MS ASP group. And then read
the posting guidelines or read other posts to see how this is done.
Usenet is a wonderfull thing and is much better when you access it
correctly! You'll be telling/showing others this in a few months.
Jeff
>
> It doesn't put the value of array a[x] element.
>
> And yes, prod_cd is unique.
>
> Tom
>
>
>
> --
> birdmant
> ------------------------------------------------------------------------
> Posted via http://www.forum4designers.com
> ------------------------------------------------------------------------
> View this thread: http://www.forum4designers.com/message109289.html
>