---
title: "Visually indicate to the user when the textbox limit has been exceeded"  
description: "Visually indicate to the user when the textbox limit has been exceeded"  
author: "Mark Devid"  
published: 2014-12-02  
updated: 2014-12-03  
canonical: https://www.mindstick.com/forum/12735/visually-indicate-to-the-user-when-the-textbox-limit-has-been-exceeded  
category: "asp.net"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Visually indicate to the user when the textbox limit has been exceeded

I am new [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) [now](https://yourviews.mindstick.com/view/81402/it-s-liberals-vs-progressives-in-us-politics-now) I need to visually indicate to the [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) when the [textbox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview) [limit exceeded](https://www.mindstick.com/forum/159504/explain-a-scenario-where-an-algorithm-might-run-into-a-time-limit-exceeded-exception). Please give a solution.

```
<asp:TextBox ID="Txtbox"runat="server" Height="50px" TextMode="MultiLine"       
Width="150px" MaxLength="50"></asp:TextBox>
```

## Replies

### Reply by Anonymous User

Try this

```
$("#Txtbox").on('input',function () {   
if($(this).val().length == $(this).attr('maxlength')) {       
$(this).css('background-color','red');    }});
```


---

Original Source: https://www.mindstick.com/forum/12735/visually-indicate-to-the-user-when-the-textbox-limit-has-been-exceeded

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
