Dear All,
My textbox ID is TextBox1, How to get its value?
I tried:
var mytext = document.getElementById("TextBox1");
or
var mytext = document.getElementById("TextBox1").value;
no luck
Printable View
Dear All,
My textbox ID is TextBox1, How to get its value?
I tried:
var mytext = document.getElementById("TextBox1");
or
var mytext = document.getElementById("TextBox1").value;
no luck
I think you just helped me figure out my problem!
I'm not sure, but I think the variable has to be the same as the id:
var TextBox1 = document.getElementById("TextBox1").value;
I could be wrong about that. Also, what I have seen is single quotes, not double so try:
var TextBox1 = document.getElementById('TextBox1').value;
Not sure if that makes a difference or not either.
I'm gonna try changing my var names now to see if it works!
Good luck!