![]() |
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. |
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 |
An HTML form with a disabled input field:
|
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 |
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. |
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.