Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable/Disable

Status
Not open for further replies.

BKer

Programmer
Apr 17, 2001
62
US
Ok I figured out how to disable a radio button, but changing the same function to enable an already disabled radio button does not work. When I try to enable a disabled combo box it says object required saying that my combo box does not exist when it does. Any help in letting me understand would be grateful.



<form name=form1 method=post action=test.asp>
<head>
<script language=&quot;javascript&quot;>
function enabling(){

document.form1.sort[0].enabled = true;

return false;
}
</script>
</head>
<p><font size=5>Aging Work Order Form</font><br><br>

<p>Search By</p>
<input type=radio name=shop value=&quot;ftr_description&quot; checked>Entire Shop
<input type=radio name=shop value=&quot;sh_name&quot; onclick=&quot;enabling();&quot;>One Trade<br>
<P>Sort By</P>
<input type=radio name=sort value=&quot;wo_request_date&quot; checked disabled>Date
<input type=radio name=sort value=&quot;wo_number&quot;>Work Order #<br>


<%
set conn=server.CreateObject(&quot;adodb.connection&quot;)
set objrs=server.CreateObject(&quot;adodb.recordset&quot;)
conn.Open(&quot;DRIVER={Microsoft ODBC for Oracle};SERVER=
objRS.Open &quot;select sh_name from f_shops&quot;, conn
if Request(&quot;cboPrimary&quot;) = &quot;&quot; then
shop= objRS(&quot;sh_name&quot;)
else
shop = Request(&quot;cboPrimary&quot;)
end if
%>

<p>
<select name=cboPrimary size=1 onChange=&quot;form1.submit();&quot;>
<%
while not objRS.EOF
varShop = objRS(&quot;sh_name&quot;)%>
<option value=&quot;<%=varShop%>&quot; <%if shop = varShop then Response.Write &quot; SELECTED&quot;%>><%=objRS(&quot;sh_name&quot;)%>
<% objRS.MoveNext
wend

objRS.Close
objRS.Open &quot;select ftr_description from f_trades, f_shops where ftr_sh_fk = sh_pk and sh_name = '&quot; & shop &&quot;'&quot;, conn

%>
</select>
</p>
<p>
<select name=cboSecondary size=1 disabled>
<%
while not objRS.EOF
varShop = objRS(&quot;ftr_description&quot;)%>
<option value=&quot;<%=varShop%>&quot;><%=objrs(&quot;ftr_description&quot;)%>
<%
objRS.MoveNext
wend
objRS.Close
set objRS.ActiveConnection = nothing
set objRS = nothing
%>
</select>
</form>
 
I forgot that java is case sensitive so I got the object to be called, but it doesn't work when I try to enable a disalbed object. Is my syntax correct?

document.form1.cboSecondary.enable = true;
 
forget about it. I got it, the only syntax is disabled. It is a learning process when your new.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top