RE: multiline textbox word limit PART 2
by Rob Prentice <RJP(at)clickdms.com>
|
| Date: |
Wed, 26 Jul 2000 12:41:52 +0100 |
| To: |
hwg-techniques(at)mail.hwg.org |
| |
todo: View
Thread,
Original
|
|
doesnt matter..... got the bugger working. someone pointed out the
'document.' wasnt there and that netscape needs it. thankyou.
take care,
rob.
-----Original Message-----
From: Rob Prentice [mailto:RJP(at)clickdms.com]
Sent: 26 July 2000 10:19
To: hwg-techniques(at)mail.hwg.org
Subject: multiline textbox word limit PART 2
hello,
thankyou everyone who replied and helped. ive got it working in IE. but
not in netscape. netscape isnt even bringing up an error. im using 4.6.
the code is...
<script>
<!--
function maxwordcount(){
var maxwords=100
if (document.images){
var temp=register.description.value.split(" ")
if (temp.length>maxwords){
alert("Sorry, but you have exceeded the 100 word limit. Please reduce
the length of your company description. Thank you.")
return false
}
}
}
//-->
</script>
the above works fine with the code on the text box being....
<textarea name="description" cols="20" rows="7" onBlur="return
maxwordcount(this)"></textarea>
someone said that they had problems with onBlur in netscape. so i tried
onChange, and i moved the script to the form box below and use the
onFocus. so when the form box was selected below it will run the JS
function. but no. so.... there in somthing in the above code somewhere
that netscape dislikes enough so it wont work, but doesnt dislike it
enough to complain about it. i dont know enough about javascript to
figure it out, and ive looked at a few places and they dont give any
hint of what the problem may be. anyone got any ideas about it?
thankyou.
Rob.
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.