Disabled TextBox If CheckBox is not selected.
Posted on 2001-06-27
Hello, I have an ASP page that dynamically generates form with checkboxes(products) and textboxes(quantity).
Therefore, if there are 4 products retrieved from database. They will be 4 checkboxes displayed along with their corresponding Quantity textbox. If the 1st product is not checked, its quantity will be disabled. Any idea on this?
Set conn = Server.CreateObject("ADODB.CONNECTION")
Set RS = Server.CreateObject("ADODB.RECORDSET")
SQL = "Select products from customer where username='inti'"
Rec = RS("products")
Rec = replace(Rec,".","")
DBRead = split(Rec,",")
Response.Write "<form onsubmit=return checkform(this) method=post action=QuatProc.asp>"
For Each DBR in DBRead
Response.Write "<input type=Checkbox Name=Products value="&DBR&">" & DBR & " " & "<input type=text name=Qty size=4 maxlength=4>" & "<br>"
Response.Write "<p><input type=submit name=Submit value=Submit></p>"
set DBRead = nothing
set rs = nothing