09-19-2011, 09:13 PM | #1 |
Registered User
Join Date: Jul 2011
Posts: 262
|
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.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
11-21-2011, 05:29 AM | #2 |
Moderator
Join Date: Sep 2011
Location: INDIA
Posts: 250
|
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
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
10-19-2015, 11:59 PM | #3 |
Registered User
Join Date: Sep 2015
Location: UK
Posts: 447
|
An HTML form with a disabled input field:
<form action="demo_form.asp"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname" disabled><br> <input type="submit" value="Submit"> </form> |
12-15-2015, 10:56 AM | #4 |
Registered User
Join Date: Oct 2015
Posts: 40
|
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
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Last edited by etechstack; 12-15-2015 at 10:59 AM.. |
12-23-2015, 02:40 AM | #5 |
Registered User
Join Date: Jun 2013
Location: New Delhi
Posts: 183
|
The impaired trait is a boolean quality.
Whenever present, it determines that the <input> 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 <input> 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 <input> component usable.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
01-01-2016, 04:40 AM | #6 |
Registered User
Join Date: Jan 2016
Posts: 28
|
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.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|