Connecting Tech Pros Worldwide Help | Site Map

onclick event in forms with javascript

Member
 
Join Date: Jul 2006
Posts: 89
#1: Jun 8 '07
Hello

I have a form in which i have some fields that are both active and in-active. All fields are visible.

When for example a specific active field (could be a radio button) is clicked the in-active field should become active. (writable)

The none-writable fields are grey and should change to black when made writable.

Can anybody please help me.
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,128
#2: Jun 8 '07

re: onclick event in forms with javascript


hi ...

let me give you an idea that probably would work:

you may give your form-elements an attribute that mark them as writeable or readonly ... or you may ask them for the readOnly property. when clicking a control you have to loop through your input-and-readonly-elements and remove the readonly-attribute or set the readOnly-property to false ...

in case that you have only some elements to respond to your click, you may add an other attribute that identifies them as belonging to the 'clicked-one' or you may hardcode a list with the ids so you may check which elements has to be enabled ...

have a look at the following thread too:

http://www.thescripts.com/forum/thread655784.html

kind regards ...
Reply