473,326 Members | 2,175 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,326 software developers and data experts.

the value for disabled

How to activate disabled button or text?
Example
<form name="form">
<input name="w1" type="checkbox" onClick="document.form.m1.??????;"> <----
what should there be? disabled="false" or unabled="true" doesn't work
blabla <input name="m1" type="text" value="" size=5 disabled>
</form>

TIA
Navall
Jul 23 '05 #1
4 1292

<input name="w1" type="checkbox"
onClick="document.form.m1.disabled=this.checked;">

<input name="w1" type="checkbox"
onClick="document.form.m1.disabled!=this.checked;" >

<input name="w1" type="checkbox"
onClick="document.form.m1.disabled=false;">

Should all work... what flavour do you want?

Jul 23 '05 #2
> <input name="w1" type="checkbox"
onClick="document.form.m1.disabled=this.checked;">

<input name="w1" type="checkbox"
onClick="document.form.m1.disabled!=this.checked;" >

<input name="w1" type="checkbox"
onClick="document.form.m1.disabled=false;">


It's exactly what I need thx a lot

Navall
Jul 23 '05 #3
Vincent van Beveren" wrote:

<input name="w1" type="checkbox"
onClick="document.form.m1.disabled=this.checked;">
As the various form controls are part of the same form the onclick
handler of any one may refer to the form in general as - this.form -
(that is not by form-name in this case, "form" is probably not the best
choice of name for a form. The form controls (- this -) all have a
property named - form - that refers to the form that contains them (if
any).). So:-

onclick="this.form.elements.m1.disabled = this.checked;"

- or -

onClick="this.form.m1.disabled=thischecked;"
<input name="w1" type="checkbox"
onClick="document.form.m1.disabled!=this.checked;" >

<snip>

That - != - operation is comparison and has a boolean result that is
never used. The balance of probability is that an assignment of NOT
this.checked was intended:-

onClick="document.form.m1.disabled= !this.checked;"

Richard.
Jul 23 '05 #4
That - != - operation is comparison and has a boolean result that is
never used. The balance of probability is that an assignment of NOT
this.checked was intended:-

onClick="document.form.m1.disabled= !this.checked;"

Richard.


Thats what I meant... I think I have been behind a screen too much
today, all the characters are floating around in my brain :)

Jul 23 '05 #5

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

Similar topics

11
by: HolaGoogle | last post by:
Hi, Sorrryy to ask such basic question but i do need your help! Here's what i'm trying to do: In my parent form i'm calling a my Iframe form to get certain value, then depending on that value...
2
by: lehmann | last post by:
Hello, Is it possible to have a disabled input in a form whose value could be sent when the form is submitted. I just need the user not to be able to change the input value, but this value is...
21
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
4
by: crjunk | last post by:
I want to set a textbox's ReadOnly value to the OPPOSITE value that the CheckBox has. For example: If the user checks the CheckBox then the ReadOnly property for the TextBox is set to False. The...
3
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get...
1
by: Hardy Wang | last post by:
Guys, I have a web form with some <Asp:TextBox> controls, on some condition, I need to trigger a client side JavaScript to clean all values of these boxes, like below: function DisableForm() {...
2
by: Alphonse Giambrone | last post by:
Hi all, I have two radiobuttonlist controls on a page. When a user checks 'No' for rblDeleted, I want to automatically set rblSendCard to 'No' and disable it. The javascript function I wrote to...
2
by: Lars Netzel | last post by:
Hi I'm having a DropDown box with 2 items... one with Value 1 and one with Value 2. If I load the page and it has Value 1 selected from page_load() and then select Value 2 on the form.. .and...
1
vyon13
by: vyon13 | last post by:
this is the code that i have copy:i tried to add new function on it,... the function is if the checkbox is unchecked the value inputed by the user will be clear... how to do that.. thanks in...
2
by: sumanta123 | last post by:
Dear Sir, In my develpment i am getting stuck for a senario.Kindly please help me for it. Everytime we give the request we get the response of 8 records and its corresponding value. Then next...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.