Visibility of elements by ID

Posted by dragonfly on Stack Overflow See other posts from Stack Overflow or by dragonfly
Published on 2010-05-27T12:35:12Z Indexed on 2010/05/27 14:21 UTC
Read the original article Hit count: 149

Filed under:
|
|

Hi,

how come that when I attach onchange by attribute and call it

onchange="validateDate(FPR_CURR_FROM);"

it works, but when I use a ASP .NET validator, and my attached function is called like :

function anonymous() {
   ValidatorOnChange(event);  
   validateDate(FPR_CURR_FROM);
}

I get error: FPR_CURR_FROM is undefined.

First off: I know that using FPR_CURR_FROM to access element is BAD, and I should use getElementByID etc... And I will change it eventually. But as I bumped into that code, I'm curious what caused it - propably visibility of variables I guess.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript