Textbox question & features

  • Thread starter Thread starter Blasting Cap
  • Start date Start date
B

Blasting Cap

I have an app that allows users to enter an order, and to make a comment
in a field.

The data field is 500 characters long....

What I'd like to do is a couple things - provide a window that will
allow them to enter comments in that box, and to not have to use the
scroll bar to navigate up & down in the box. Is there a way to do that?


Second question, since this field is limited to 500 characters - I'd
like to have a label that would tick off the number of characters left
in the field. Is this something I can do with anything in dotnet, or is
it some sort of javascript add-in?

Thanks,

BC
 
What I'd like to do is a couple things - provide a window that will allow
them to enter comments in that box, and to not have to use the scroll bar
to navigate up & down in the box. Is there a way to do that?

Not quite sure I understand what you mean - you don't *have* to use the
scrollbar to navidate up and down in a multiline textbox - the up and down
arrows will work just as well - is that what you mean...?
Second question, since this field is limited to 500 characters - I'd like
to have a label that would tick off the number of characters left in the
field. Is this something I can do with anything in dotnet, or is it some
sort of javascript add-in?

You'll want to do this client-side, so it's a JavaScript function - loads of
examples can be found through Google:
http://www.google.co.uk/search?sour...LG:2006-28,GGLG:en&q=textarea+character+count
 
Hi again Cap,

1. See my reply to your post above
2. Example:

<asp:TextBox runat="server" ID="comments" TextMode="MultiLine"
MaxLength="500" onkeyup="GetCharactersLeftCount()"/>
<asp:Label runat="server" ID="charactersLeft" Text="500"/>

<script type="text/javascript">
function GetCharactersLeftCount()
{
var txt = document.getElementById('<%=comments.ClientID %>');
var lab = document.getElementById('<%=charactersLeft.ClientID %>');
lab.innerHTML = 500 - txt.value.length;
}
</script>

hope this helps
 
Back
Top