I am struggling with the following code intended to check for a blank value in my textbox, but it is resulting in a compilation error. Can someone help me find a solution?
Here is my code in JavaScript:
function checkTextboxNotFilled(txtbox) {
var txtb = document.getElementById("<%= " + txtbox + ".ClientID %>");
if (GetFormattedString(txtb.value) == "") {
return true ;
}
else {
return false ;
}
}
The error message states:
'string' does not contain a definition for 'ClientID' and no extension method 'ClientID' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
I am invoking it like this: checkTextboxNotFilled("MytextboxName")