First add an external JavaScript file to the ASPX page:
<script type="text/javascript" src="external_javascript.js"></script>
Then when you want to check for textbox content (filled or empty), just pass its value to the function defined in the external javascript file.
There in the function, you can trim(if spaces are to be avoided) and check the length if it contains any text. Based on it, return true or false.