Hey there,
Im relatively new to ASP and am having a bit of a situation and so far google hasn't been too helpful! so hopefully someone here can help!
Heres is the situation.
I have a form with a bunch of text and radio fields that load up empty or with some default radio value. what im trying to do is based on a DB Query if there is a ?recordId= in the url, if the record already exists have the fields filled in so they can be editted.
I haven't had any problems changing the text fields. I just used ASP to write some Response.write some java script basically doing
FormName.FieldN ame.value =
and it works fine.
What i cant figure out is how you can change radio values checked values using a similar method.
If anyone can help me out please let me know!! thank you! :)
Miles!
P.S. If it helps here is how the radios are set up. This is default if it is a new record. Each responsibility has 3 radio options associated with it. Add, Delete, and No Change. But the number of responsibilitie s is dynamic and queried from database.
Im relatively new to ASP and am having a bit of a situation and so far google hasn't been too helpful! so hopefully someone here can help!
Heres is the situation.
I have a form with a bunch of text and radio fields that load up empty or with some default radio value. what im trying to do is based on a DB Query if there is a ?recordId= in the url, if the record already exists have the fields filled in so they can be editted.
I haven't had any problems changing the text fields. I just used ASP to write some Response.write some java script basically doing
FormName.FieldN ame.value =
and it works fine.
What i cant figure out is how you can change radio values checked values using a similar method.
If anyone can help me out please let me know!! thank you! :)
Miles!
P.S. If it helps here is how the radios are set up. This is default if it is a new record. Each responsibility has 3 radio options associated with it. Add, Delete, and No Change. But the number of responsibilitie s is dynamic and queried from database.
Code:
<%
SQL_query1 = "SELECT * FROM casResponsibility ORDER BY casGroup ASC"
Set RS1 = MyConn.Execute(SQL_query1)
%>
<tr>
<td><input name="<%=RS1("casRespId")%>" type='radio' value='add' onclick="<%Response.write("changeDiv('" & RS1("casRespId") & "add','block');changeDiv('" & RS1("casRespId") & "delete','none')")%>" /></td>
<td><input name="<%=RS1("casRespId")%>" type='radio' value='delete' onclick="<%Response.write("changeDiv('" & RS1("casRespId") & "add','none');changeDiv('" & RS1("casRespId") & "delete','block')")%>" /></td>
<td><input name="<%=RS1("casRespId")%>" type='radio' value='nochange' onclick="<%Response.write("changeDiv('" & RS1("casRespId") & "add','none');changeDiv('" & RS1("casRespId") & "delete','none')")%>" checked="checked" /></td>
<td><%=RS1("casGroup")%>-<%=RS1("casTask")%></td>
</tr>
<% RS1.MoveNext %>
<% WEND %>
Comment