codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Needs Java script help  TPsingh at 21:56 on Tuesday, May 02, 2006
 

We are trying to implement a counter for the character in an open-ended textarea question and we are using the JavaScript to do the following 2 functions:



Ø Validate the number of characters remaining in the textarea.

Ø Provide an alert when limit of characters is reached.



Now, the issue is that same page is working fine in Internet Explorer but it is not working in the Mozilla web browser.



Please provide us with some solution for above problem. Your prompt reply will be appreciated.

I am using the following script:

<script language = "Javascript">

function taLimit() {
var taObj=event.srcElement;
if (taObj.value.length==taObj.maxLength*1) return false;
}

function taCount(visCnt) {
var taObj=event.srcElement;
if (taObj.value.length>taObj.maxLength*1) taObj.value=taObj.value.substring(0,taObj.maxLength*1);
if (visCnt) visCnt.innerText=taObj.maxLength-taObj.value.length;
}


<TR><TD align="center"><br>
<TEXTAREA onkeypress="return taLimit()" onkeyup="return taCount(myCounter)"
name="cus43_oe1" rows=7 wrap=physical cols=75 maxLength="1000" align="center">








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Help !! -- Array Declaration --
•  loading external code
•  submit button
•  SQL stored procedure error
•  Needs Java script help
•  Problem with XML
•  RMI server problem
•  Re: help please for newbie to java and i/o
•  Help !! -- Array Declaration --


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006