Dynamic lable for text box

They have: 1 posts

Joined: Jan 2011

Hi,
I am new to this HTML and JS. I knew perl. In perl CGI I have a task to be completed. In that I am using 4 fields with 4 text boxes. I wanted to have 2 text box with 4 names. Names has to be changed dynamically based on the selection.

Here is the code :

Sample script

.hiddenDiv {display: none;}
.visibleDiv {display: block;}

Choose One...
first
second

AName
AID

CName
CId

In the above program, both text boxes as well as the names getting changed dynamically. But I want the name has to be changed dynamically by having only 2 text boxes. Please guide me.