Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
kt03 #1
disable/enable
I have a form to included these file
1. Radio buttons. button1, button2
2. Some text boxes: fname, lname, address, phone, etc.
3. Some submit buttons
When user click on radio button1, all the textboxes were enable, and when user
click on radio button 2, all the text box were disable. I made it working,
however, when user click on radio button1 and fill out the information then
click on submit button then all the text box were disable because these text
fields were depend on the disable/enable function. How do keep these text box
enable when I click on the submit button?
kt03 Guest
-
Enable Disable fields onclick
I have a cfinput field that is disabled when the form first loads (disabled="true") I want to click a button to enable the field. ... -
Validators Enable & Disable Issue
Hi Guys , I have used few validators on few fields in my form, i have a reset button which reset the current contents of those fields. When i do... -
enable/disable
How can do disable and enable for radio box? it worked for all my text box but not for radio box ======= <script language="JavaScript"> function... -
NEED HELP W/ ENABLE/DISABLE CHECKBOXES AND TEXTBOXES
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another... -
Wanted:PL/SQL to Disable & Enable Constraints
I need one or two PL/SQL's that will let me - Disable ALL Constraints for one or more tables and at a later time - Enable ALL Constraints... -
vkunirs #2
Re: disable/enable
Hi
r u calling the radio button function on the submit button.?
vkunirs Guest
-
kt03 #3
Re: disable/enable
No, I have the disable/enable funciton and used Onclick to calling these fc for radio button. I didn't calling any fc for submit buton. what should I do?
kt03 Guest
-
gwgiswebmaster #4
Re: disable/enable
you'd be better off either using layer hiding via styles and javascript, or <cfparam> on your action page for those fields.
gwgiswebmaster Guest
-
-
kt03 #6
disable/enable
This code is woked if both text box name diffrentlly, but insn't worked when I
have the same name.
What should I do to make it work if I have the same name for both text box?
<input type="text" class="thDarkL" size="30" name="email_address" disabled>
<input type="text" class="thDarkL" size="30" name="email_address" disabled>
<input type="radio" class="tdbg" name="fc" value="5" onclick
="EnableNewEmail();">
<input type="radio" class="tdbg" name="fc" value="5" onclick
="DisableNewEmail();">
<script type="text/javascript">
function DisableNewEmail()
{ document.frm.email_address.disabled=true; }
function EnableNewEmail()
{document.frm.email_address.disabled=false; }
</script>
kt03 Guest
-
WestSide #7
Re: disable/enable
why are they named the same? How can they be unique if they have the same name.
If you need multiple values to be selectable, then use a multi select list.
-westside
WestSide Guest
-
jeby #8
Re: disable/enable
Two form fields have to have 2 different names... If they are both
"email_address" you will have no way to validate that they are the same...
Just name them:
email_address1
email_address2
then modify your functions to
function DisableNewEmail()
{ document.frm.email_address1.disabled=true;
document.frm.email_address2.disabled=true }
function EnableNewEmail()
{document.frm.email_address1.disabled=false;
document.frm.email_address2.disabled=false }
jeby Guest
-
newcf #9
disable/enable
Hi,
I have one check box and one textbox. First time, when user opens the page,
the textbox is disabled. If user check the checkbox, then textbox is enabled,
else, user un-check the checkbox then textbox is disabled. My code is work
only one way to make the textbox enabled but can?t make the textbox disable
again.
Please see the attached code below
==========================
function EnableKey(){
document.frm.key_expiry.disabled=false;
}
function DisableKey(){
document.frm.key_expiry.disabled=true;
}
Form. cfm
=====================
<input type="checkbox" name="col" value="1" onClick='EnableKey();'>Temp
Key Expiry<input id="demo1"type="text" name="key_expiry" disabled value="">
newcf Guest
-
Kronin555 #10
Re: disable/enable
function toggleEnabled(){
if(document.frm.key_expiry.disabled) {
document.frm.key_expiry.enabled = true;
} else {
document.frm.key_expiry.disabled=false;
}
}
Form.cfm
=====================
<input type="checkbox" name="col" value="1" onClick='toggleEnabled();'>Temp
Key Expiry<input id="demo1"type="text" name="key_expiry" disabled value="">
Kronin555 Guest
-
mxstu #11
Re: disable/enable
.... or you could also use ...
<script type="text/javascript">
function toggleEnabled(){
document.frm.key_expiry.disabled = !document.frm.key_expiry.disabled;
}
</script>
....
<input type="checkbox" name="col" value="1" onClick='toggleEnabled();'>Temp
....
mxstu Guest



Reply With Quote

