Hello everybody,
I have a TextBox server control and I need to set the text using JavaScript. I am using following code but this doesnt work for me.
Code:document.getElementById("daysTextBox").value = "Some Text";
Printable View
Hello everybody,
I have a TextBox server control and I need to set the text using JavaScript. I am using following code but this doesnt work for me.
Code:document.getElementById("daysTextBox").value = "Some Text";
This line looks fine, I think you need to look elsewhere for the issue - is the javascript procedure this line is contained within, being called & executed properly? Does the final HTML list this control daysTextBox with an Id attribute in it's tag?
How are you running it? Adding an attribute to some existing element?
This statement is written in a function and the function is executed on onChange of a DropDown.
I didn't understand that. Show all relevant code.