I have a text box element whose value I am trying to access using document.getElementById(\"id-name\").value
. I find that the call is returning a null instead o
Posting your HTML might help a bit. Instead, you can get the element first and then check if it is null or not and then ask for its value rather than just asking for the value directly without knowing if the element is visible on the HTML or not.
element1 = document.getElementById(id);
if(element1 != null)
{
//code to set the value variable.
}