I'm pretty sure you want 
                        document.getElementById(textInputID).disabled  =
true 
                not 
                        document.getElementById(textInputID).style.disabled
= true;



-----Original Message-----
From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 17, 2007 9:26 AM
To: CF-Talk
Subject: Re: OT: javascript


in this case, you don't need 'foo'.  just 'moo'.  even though they could be
in different forms, an id value should not be repeated on a page.

so...

function disabler(textInputID) {
       document.getElementById(textInputID).style.disabled=true;
}

<form id="foo">
<input type="text" id="moo" />
<input type="button" onclick="disabler('moo');" /> </form>

On 5/17/07, Chad Gray <[EMAIL PROTECTED]> wrote:
> I want to write a javascript function that I can use on all of my forms
and inputs to disable a text input.  So I want to pass to the function the
form's ID and the text input's ID to be disabled.
>
> How do I append the functions attributes to my document command?
>
> My javascript below does not work.
>
>
> Function disabler(formID,textInputID) {
>
>         document.formID.textInputID.disabled=true;
>
> }
>
> <form id="foo">
> <input type="text" id="moo">
> <input type="button" onClick="disabler('foo','moo');"> </form>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278461
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to