Hi,
I am working on this project where I am dynamically creating a radio button based on the database values. I am using HTML, ASP and COM Components. The portion where I grab the data from the database is working fine.
<%
For i = 1 to varDriverCount %>
<input type="radio" name="Design" value="<% = varArrayInfo(2,i,0) %>" <% If varArrayInfo(2,i,0) = radDesign Then Response.Write "Checked" %> ID="Radio1">
<a href="/Design<%=i%>.gif"><%Response.Write varArrayInfo(0,i,0) & " " & varArrayInfo(1,i,0)%></a></td>
The above portion of dynamically creating radio buttons based on the array that contains the values from the database is also working fine. varArrayInfo(0,i,0) would contain the First Name of the person who created design. varArrayInfo(1,i,0) would contain the Last Name of the person who created design. varArrayInfo(2,i,0) would contain the value of the design i.e; 1. varArrayInfo(3,i,0) contains the values for another radio button "Style".
Based on what the customer clicks for "Design" radio button, I need to display or enable/disable another radio button "Style" if the value of varArrayInfo(3,i,0) is 1 because only on certain instances I need to display that "Style" radio button for ex; only if the database has the value 1. I am not sure what would be the best way to accomplish this. Please advice!
Thanks!!
JavaScript is the way to go, as the other response noted.
If you just want to disable, rather than hide, the optional input, then you can set or unset the disabled attribute on it:
window.formX.fieldY.setAttribute("disabled","true");
window.formX.fieldY.removeAttribute("disabled");
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 1  Reply