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>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278456
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