check with javascript if textbox is empty while using ajaxcontroltoolkit TextBoxWatermark

I have an TextBox and I'm using the TextBoxWatermark of AjaxControlToolkit to have it display some hing text while the box is empty.

Problem is, onclient click of a certain button, I want to determine if the textbox is empty. The javascript code of

document.getElementById(fieldName).value == ""

Is not working, since the WaterMark extender with it's hint text making the code to think the field is not empty.

Any solution to this?


You can use the wrapper to access whether the watermark is being displayed or not with get_IsWaterMarked.


I tried this with version of AjaxControlToolKit.

Got the code from looking at the source code of the TextBoxWatermark control. Refer to this:

Need Your Help

Disable Orientation in iphone app. iOS 7 - Xcode 5

ios iphone orientation landscape

I created iphone and ipad app using Xcode 5, iOS 7.

How to keep the AngularJS template updated while getting socket updates?

angularjs sockets

I get updates from the Backend via socket connections. I want to have an automatically updating Frontend with AngularJS while using a data object for the data I got from the Backend.