Try using jQuery:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var textbox = document.getElementById('<%= TEXTBOX.ClientID %>');
var button = document.getElementById('<%= SEND.ClientID %>');
$(SEND).click(function() {
// do validation here
});
});
</script>
the SEND above is an asp.net button control. The logic here is to validate the textbox upon clicking the SEND button. Try studying jQuery. Its easier than javascript
For your reference:
http://www.w3schools.com/jquery/default.asp
Best regards,
Eduard