ronan_40060
asked on
OnChange text Change
Hello Experts
Im writing a Small javaScript function that will change text Box name on change of Yes/No of Drop Down box Multiple Recipients
E.G
If Multiple Recipients Drop Down has Yes then the text Box name below should have the name displayed Group Address else If No is selected then the text filed below has the nameCust Email Address.
I have attached the code snippete of what I have written so far
Thanks in advanced
Im writing a Small javaScript function that will change text Box name on change of Yes/No of Drop Down box Multiple Recipients
E.G
If Multiple Recipients Drop Down has Yes then the text Box name below should have the name displayed Group Address else If No is selected then the text filed below has the nameCust Email Address.
I have attached the code snippete of what I have written so far
Thanks in advanced
function function1(text) {
var col = (text.options[text.selectedIndex].value);
if (col) {
document.write('Cust Email Address');
}
alert("The Text has changed to "+col)
}
ASKER
Neeraj
yes Im looking to change the name of a textbox on the change event of drop down
Thanks
yes Im looking to change the name of a textbox on the change event of drop down
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is How my code looks like
function textChange(text)
{
alert("inside Text Change Function");
var col = (text.options[text.selecte dIndex].va lue);
alert(col)
if (col == "true")
{
document.getElementById("c ustEmailAd dress").na me = "Group's Name:";
document.getElementById("c ustEmailAd dress").va lue = "'Group's Name:'";
}
else
{
document.getElementById("c ustEmailAd dress").na me = "Cust Email Address";
document.getElementById("c ustEmailAd dress").va lue = "Cust Email Address";
}
}
Now when I call this function from JAVA FE with Drop down value changed to YES , Cust Email Address values gets populated in the text filed instead of changing the TextBox name
custEmailAddress is the id that Im using
function textChange(text)
{
alert("inside Text Change Function");
var col = (text.options[text.selecte
alert(col)
if (col == "true")
{
document.getElementById("c
document.getElementById("c
}
else
{
document.getElementById("c
document.getElementById("c
}
}
Now when I call this function from JAVA FE with Drop down value changed to YES , Cust Email Address values gets populated in the text filed instead of changing the TextBox name
custEmailAddress is the id that Im using
I dont understand why you want to change the name of textbox on some event..
anyway.. value of the text box is changing because of
document.getElementById("c ustEmailAd dress").va lue = "'Group's Name:'";
document.getElementById("c ustEmailAd dress").va lue = "Cust Email Address";
lines.. i added these lines to show you how the things r changing.. if u delete these two lines.. value wont be changed..
anyway.. value of the text box is changing because of
document.getElementById("c
document.getElementById("c
lines.. i added these lines to show you how the things r changing.. if u delete these two lines.. value wont be changed..
any further info needed ??
Your question is not very clear. Can you elaborate it a bit..
Are you looking to change the name of a textbox on the change event of drop down ?
neeraj523