Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

testing my site right now on the Internet *crossing fingers*

 

Need to fix one thing though if someone has an answer on this.

 

I have a box that requires the member to type at least 200 characters. is there a way to show the number of characters currently being typed ? That way the member doesn't have to count them or click a button to find how many are left?

 

All I have is a textbox multiline and a label that will show the characters typed after the member clicks a button to refresh.

Posted

Thanks.

 

Is there a sample that you could show me?

 

or a website that has a sample of something similar to that?

 

could it be vbscript also?

Posted

For Internet Explorer..

 

<script language="javascript">

 

function numChars(formfield) {

 

document.getElementById('Characters').innerText = formfield.value.length;

}

 

</script>

<p><span id="Characters"></span></p>

<form name=form1>

<input type=text name="Count" onKeyUp="numChars(this);">

</form>

Posted

Hmm.. Still see to have a slight problem now

 

The javascript works when it's a textarea box that's not set with runat="server"

 

Is there anyway to make that javascript run when the textarea is set to run at server mode?

 

What I have is a list of textboxes, listboxes, etc that the user fills out. they click a save button that will run a vb.net function in aspx. this stores the stuff in a database. I also need to have the person know how many characters they have left (or using) for an essay question that requires 200 characters min, and 500 characters max. I really dont' want them having to manually count the characters or wait till they hit save just to find out they are short 103 characters or whatever.

Posted
Are you adding the onKeyUp to the textarea's attributes?

yes, I changed that now for it to work some. BUT THEN found something else that works good enough for me on teh server-side. I'm using the validator tools and applying them to the boxes. this works about the same "dynamic displaying" except it doesn't show the number of keys pressed. but that's ok for now. At least my site is done.

 

I'm hoping it's done.. still have to see what happens when live people touch it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...