displaying a list of check boxes based on a sql query (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


zacky0 -> displaying a list of check boxes based on a sql query (7/14/2003 17:50:28)

Hi,

Iam trying to do the following.

I have a list of about 50 checkboxes that are displayed on the ASP form.
I need to enable the checkboxes as available and also disable the checkboxes as not available for the user based on the result from a SQL query using javascript.

NB : The sql query returns the name of the checkbox that are avl as a column of the result set.

The below code does not work currently.
I need some help to complete or change the following code to help solve my requirement.

<%
Sql = " select * from Sponsor_TBL"
Set rs = conn.Execute(SQL)
Do while not rs9.eof
if rs(4) <> " 0" then
cbox = rs9(0) %>
<script language = " javascript" >
document.all[" cbox" ].disabled = true;
</script>
<%
end if
rs9.movenext
loop %>



Thanks
zack.




Spooky -> RE: displaying a list of check boxes based on a sql query (7/15/2003 16:57:36)

If you dynamically write each checkbox, then just add " disabled" to the html code.

eg <input type=checkbox disabled>

Note that its not supported on all browsers.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875