I am having trouble with having a radio button stay in the same position when the form Iam using submits to itself. When it submits the radio buttons go back to their default positions. I also have a radio button that enables a drop down menu, but again when the form submits to itself the drop down is disabled. Here is the code. I am sure it is easy but it is frustrating me. Thanks for the help.
<form name=form1 method=post action=test.asp>
<head>
<script language="javascript">
function disabling(){
if (document.form1.radShop[0].checked=true){
document.form1.cboSecondary.disabled= true;
}
return;
}
function enabling(){
if (document.form1.radShop[1].checked=true){
document.form1.cboSecondary.disabled= false;
}
return;
}
</script>
</head>
<p><font size=5><em><b>Aging Work Order Form</b></em></font>
<hr>
<p>Search By</p>
<input type=radio name=radShop value="ftr_description" checked onclick="disabling();">Entire Shop
<input type=radio name=radShop value="sh_name" onclick="enabling();">One Trade
<P>Sort By</P>
<input type=radio name=sort value="wo_request_date" checked>Date
<input type=radio name=sort value="wo_number" onClick="form1.submit()">Work Order #
<%
set conn=server.CreateObject("adodb.connection"
set objrs=server.CreateObject("adodb.recordset"
conn.Open("DRIVER={Microsoft ODBC for Oracle};SERVER=;UID=;PWD="
sql= "select distinct ftr_description, wk_title, wk_start_date, wk_last_name, wk_first_name, wk_id_code from f_trades, f_personnel where wk_ftr_fk = ftr_pk and wk_active = 'YES'"
objRS.Open "select sh_name from f_shops", conn
if Request("cboPrimary"
= "" then
shop= objRS("sh_name"
shopX = shop
else
shop = Request("cboPrimary"
end if
%>
<p>
<select name=cboPrimary size=1 onChange="form1.submit();" >
<%while not objRS.EOF
varShop = objRS("sh_name"
%>
<option value="<%=varShop%>" <%if shop = varShop then Response.Write " SELECTED"%>><%=objRS("sh_name"
%>
<%
objRS.MoveNext
wend
objRS.Close
objRS.Open "select ftr_description from f_trades, f_shops where ftr_sh_fk = sh_pk and sh_name = '" & shop &"'", conn
%>
</select>
</p>
<p>
<select name=cboSecondary size=1 disabled>
<%
while not objRS.EOF
varShop = objRS("ftr_description"
%>
<option value="<%=varShop%>"><%=objrs("ftr_description"
%>
<% objRS.MoveNext
wend
objRS.Close
set objRS.ActiveConnection = nothing
set objRS = nothing
%>
</select>
</form>
<form name=form2 method=post action="testwo.asp">
<%if request("sort"
= "" then
newsort = "wo_request_date"
else
newSort = request("sort"
end if
Response.Write (newsort) %>
<input type=hidden name="shopx" value="<%=shopx%>">
<input type=hidden name="cboprimary" value="<%=shop%>">
<input type=hidden name="cbosecondary" value="<%=varshop%>">
<input type=hidden name="sort" value="<%=newsort%>">
<input type=submit id=submit1 name=submit1 action="testwo.asp">
</form>
<form name=form1 method=post action=test.asp>
<head>
<script language="javascript">
function disabling(){
if (document.form1.radShop[0].checked=true){
document.form1.cboSecondary.disabled= true;
}
return;
}
function enabling(){
if (document.form1.radShop[1].checked=true){
document.form1.cboSecondary.disabled= false;
}
return;
}
</script>
</head>
<p><font size=5><em><b>Aging Work Order Form</b></em></font>
<hr>
<p>Search By</p>
<input type=radio name=radShop value="ftr_description" checked onclick="disabling();">Entire Shop
<input type=radio name=radShop value="sh_name" onclick="enabling();">One Trade
<P>Sort By</P>
<input type=radio name=sort value="wo_request_date" checked>Date
<input type=radio name=sort value="wo_number" onClick="form1.submit()">Work Order #
<%
set conn=server.CreateObject("adodb.connection"
set objrs=server.CreateObject("adodb.recordset"
conn.Open("DRIVER={Microsoft ODBC for Oracle};SERVER=;UID=;PWD="
sql= "select distinct ftr_description, wk_title, wk_start_date, wk_last_name, wk_first_name, wk_id_code from f_trades, f_personnel where wk_ftr_fk = ftr_pk and wk_active = 'YES'"
objRS.Open "select sh_name from f_shops", conn
if Request("cboPrimary"
shop= objRS("sh_name"
shopX = shop
else
shop = Request("cboPrimary"
end if
%>
<p>
<select name=cboPrimary size=1 onChange="form1.submit();" >
<%while not objRS.EOF
varShop = objRS("sh_name"
<option value="<%=varShop%>" <%if shop = varShop then Response.Write " SELECTED"%>><%=objRS("sh_name"
<%
objRS.MoveNext
wend
objRS.Close
objRS.Open "select ftr_description from f_trades, f_shops where ftr_sh_fk = sh_pk and sh_name = '" & shop &"'", conn
%>
</select>
</p>
<p>
<select name=cboSecondary size=1 disabled>
<%
while not objRS.EOF
varShop = objRS("ftr_description"
<option value="<%=varShop%>"><%=objrs("ftr_description"
<% objRS.MoveNext
wend
objRS.Close
set objRS.ActiveConnection = nothing
set objRS = nothing
%>
</select>
</form>
<form name=form2 method=post action="testwo.asp">
<%if request("sort"
newsort = "wo_request_date"
else
newSort = request("sort"
end if
Response.Write (newsort) %>
<input type=hidden name="shopx" value="<%=shopx%>">
<input type=hidden name="cboprimary" value="<%=shop%>">
<input type=hidden name="cbosecondary" value="<%=varshop%>">
<input type=hidden name="sort" value="<%=newsort%>">
<input type=submit id=submit1 name=submit1 action="testwo.asp">
</form>