473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

enable a textlable with javascript

Hi, I have disabled a checkbox and a the lable for that (text in a
<td>)

<td class="label" width="90" id="recalc" disabled>Recalculate
price</td>
<td><input type="checkbox" name="cbRecalc" tabindex="3" size="15"
maxlength="35" value="<%=sRecalc%>" disabled>

When onChange on a drop down meny I whant to enable both of the above.
I have tried the following javascript. The checkbox is enabled, but
not the text in the table.

function enableCheckbox()
{
frmMain.cbRecalc.disabled = false;
frmMain.recalc.disabled = false;
}

Can someone please give me a suggestion of something that works :-)
/Anna
Jul 23 '05 #1
1 1242
Anna wrote on 18 jan 2005 in comp.lang.javascript:
Hi, I have disabled a checkbox and a the lable for that (text in a
<td>)

<td class="label" width="90" id="recalc" disabled>Recalculate
price</td>
<td><input type="checkbox" name="cbRecalc" tabindex="3" size="15"
maxlength="35" value="<%=sRecalc%>" disabled>


<td> does not "do" anything anyway,
so disabling a <td> is a false concept.

Perhaps you want to make a <tr> content invisible or non-displaying?

The containing checkbox wil not be available to change then,
and probably does not have to be disabled.

Try this:

================================================== ===

<table border=1>
<tr><td>=======</td><td>=======</td></tr>

<tr id="myTr1"><td>Recalculate price</td><td>
<input type="checkbox" value="<%=sRecalc%>">
</td></tr>

<tr><td>=======</td><td>=======</td></tr>

<tr id="myTr2"><td>Recalculate price</td><td>
<input type="checkbox" value="<%=sRecalc%>">
</td></tr>

<tr><td>=======</td><td>=======</td></tr>
</table>

<button onclick="hide()">Hide/show</button><br>
<button onclick="noDisplay()">Nodispaly/display</button><br>
<script type="text/javascript">
var myTr1 = document.getElementById("myTr1");
var hide1=false;
var myTr2 = document.getElementById("myTr2");
var ndis1=false;

function hide(){
hide1 = !hide1
myTr1.style.visibility=(hide1)?"hidden":"visible"
}

function noDisplay(){
ndis1 = !ndis1
myTr2.style.display=(ndis1)?"none":"block"
}

</script>

================================================== ====

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: cotton_gear | last post by:
Hi, Depending on the user input I need to disbale/enable some of the links in my page. When disbled I need to display the links as normal text with cursor changed to mouse pointer style and when...
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
1
by: Mario Hébert | last post by:
I have a simple C# object(class) that I reference in a <OBJECT classid="mydll.dll#nmsp.Ctrl"> tag of an HTML page generated by ASP.net. In a case where the Enable content expiration isn't checked...
0
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with BrowserCapability class. But what if the client has disable...
2
by: xazos79 | last post by:
Hi All, I've come across the problem of not being able to re-enable a radio button with javascript if its initial state has been disabled in the Page_Load() method of the code behind. Might i...
6
by: Anshul | last post by:
I want to check through perl whether javascript is enabled or disabled in mozilla browser. If it is disabled I want to display a message to user to enable it. What code can I use please help. I...
0
by: jason.richard | last post by:
Hi Does anyone know how to disable and enable ConfirmButtonExtender, using Javascript? I don't want the ConfirmButtonExtender to be enable until a change to a text box has been made. Here...
10
by: viki1967 | last post by:
Disable/enable icon.gif Hi all. I have this form in the page.htm: <form action="form.asp" method="post" onsubmit="return(validateForm(this));"> <select size="1" name="t_im"...
9
by: Oriane | last post by:
Hi, I can set a breakpoint in my javascript client side code, but as sson as I start the Ajax Asp.Net application in debug mode, an exlamation mark shows up on the breakpoint, and a tooltip...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.