473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Character count in textbox

Hi Folks,

I am trying to set up some code that will provide a character count
for the text entered into a textbox on my form. I am coding in VB.Net
using visual studio 2003 - web appliaction.

I have sorted the VB code, which when execute via a command button it
updates the label.

Private Sub txtcomment_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox1.TextChanged

Label1.Text = TextBox1.MaxLength - TextBox1.Text.Length
End Sub

I want to run this code dynamically so that the update happens in rel
time, however I cant seem to get any compatable Javascript that works
with text changed.

Does anyone have any ideas??

Thanks in advance,

Simon
Dec 12 '07 #1
2 10751
Guys,

I have finally found a solution. There is a custom C# control that
councts words and characters available for free at
http://aspnet.4guysfromrolla.com/articles/103107-1.aspx .

Thanks,

Simon

Dec 12 '07 #2

"si_owen" <s.****@sstaffs.gov.ukwrote in message
news:b4**********************************@s8g2000p rg.googlegroups.com...
Hi Folks,

I am trying to set up some code that will provide a character count
for the text entered into a textbox on my form. I am coding in VB.Net
using visual studio 2003 - web appliaction.

I have sorted the VB code, which when execute via a command button it
updates the label.

Private Sub txtcomment_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TextBox1.TextChanged

Label1.Text = TextBox1.MaxLength - TextBox1.Text.Length
End Sub

I want to run this code dynamically so that the update happens in rel
time, however I cant seem to get any compatable Javascript that works
with text changed.

Does anyone have any ideas??
To be dynamic, you should use javascript instead of making a trip to the
server every time something grunts.
Dec 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Walter Brunswick | last post by:
Is there any way to iterate through a sequence of characters to find N consecutive equivalent characters? So, for example, the string "taaypiqee88adbbba" would return 1 if the number (of...
9
by: refer_to_website | last post by:
My VB.NET web application has a textbox where the user is allowed to enter up to 50 characters. I have a label on the form next to the textbox that tells the user how many remaining characters he...
9
by: Jerry | last post by:
In limiting textbox input to 500 characters I would like to include a dynamic count of characters input while the user is typing into a textbox. This would obviously be a client side control,...
3
by: Kuups | last post by:
Hi! I have a question regarding the count if character within a string like for example I have a string of e.g. 123#123# I would like to determine what is the code? of getting the # sign
3
by: BJ | last post by:
Ever see those nifty sites that allow you to type text into a single or multi line text box and decrement from the maximum number of characters to 0? This lets the user know they are approaching...
3
by: Venkatachalam | last post by:
Hello, I am reading a Column form the DataTable and have to display in the RichTextBox/TextBox (With Multi-line). When I try to do so: The width occupied by each charaters are not same and that...
4
by: Anthony P. | last post by:
Hello Everyone, I'm building an application and need to keep track of the amount of text in a textbox to make sure the user knows how many characters they have left to type. I've set the...
40
by: Tameem | last post by:
hi my name is tameem. i am a new c programmer. in a c program i want to give input ""tameem"" and the output will be ""xdphhp"" in a short: the character ""a"" will be replaced by ""d"" i can...
4
by: HenrikL | last post by:
Hi! I have textbox that have fixed size in GUI and I need to know how many character I can put into it. For example, the textbox can contain 5 character in GUI and I wan to check if this string...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.