Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Javascript (http://siteownersforums.com/forumdisplay.php?f=24)
-   -   How can I Disable a Form Field? (http://siteownersforums.com/showthread.php?t=51205)

ncjbhd 09-19-2011 09:13 PM

How can I Disable a Form Field?
 
Hi,
I know how to disable a field if a checkbox is checked, but I need to disable it if another text field has a "0" in it. For instance...
Let's say I have 2 fields - bikes and redbikes.
If I say I have 2 bikes I want to know how many are red. But if I have "0" bikes, I want to disable the redbikes field (since I already know I have no red bikes).
Can anyone give me an idea how to do this?
Thanks for your thoughts.

Spoint_Vinil 11-21-2011 05:29 AM

you can use disable property of field you re using fir this purpose.
see the code seems like this


document.form_1.text_1disable=true

smmexpertss 10-19-2015 11:59 PM

An HTML form with a disabled input field:


First name:

Last name:



etechstack 12-15-2015 10:56 AM

Set attribute as disabled in input tag. if you want to disable on runtime use jquery attr to disable attribute by using selector id or class.

JPG to PNG Converter
Image Resizer
LIST OF ALL CMD COMMAND

LINK GODADDY SUBDOMAIN TO TUMBLR

varunindia88 12-23-2015 02:40 AM

The impaired trait is a boolean quality.

Whenever present, it determines that the component ought to be impaired.

An incapacitated info component is unusable and un-clickable.

The debilitated credit can be set to keep a client from utilizing the component until some other condition has been met (like selecting a checkbox, and so forth.). At that point, a JavaScript could uproot the incapacitated esteem, and make the component usable.

James More 01-01-2016 04:40 AM

To implement this functionality you can use jquery and check if the filed is zero than other field will be disable.Moreover you can easily find the examples of this over google.


All times are GMT -7. The time now is 10:01 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.