View Full Version : disable form fields function

12-09-2004, 08:53 AM
I'm a Javascript newbie.

The following function, actived by a radio button with onClick="X_disableField(this.form)", disables some input text (text1, text2) fields.

function disableField (obj)

Since I have to reply this N times, I would insert in place of X a parameter like:

function disableField (obj,par)
which is called by onClick="Y_disableField(this.form,'Y')"

but this not works at all..... thanks!

Willy Duitt
12-09-2004, 04:54 PM
Your function is named: disableField
Not: X_disableField or Y_disableField

Of course it will not work if you are calling functions that are not present...

If you need to use this multiple times pass different parameters as arguements to the function: disableField


12-09-2004, 05:01 PM
This may work:

function disableField (obj,par)
obj(par + "_text1").disabled=true;
obj(par + "_text2").disabled=false;

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum