<< Previous Topic | Next Topic >>  

how many chars left

July 11 2003 at 12:07 AM
  (Login BilgeRat)

 
didn't we have it in here? Can'T find it now, am in a hurry...

just tried a little with JS, would want to have the chars counting back within a separate text-input ... alas n54 don't have a name for their post-form, it is an id (
Quote:
id=postform
) so no success with n54.

But I'm happy to have it get working on another place of mine where I'm able to name the forms and textareas myself
char-counter in action

Here's the script I used for it, hope I've posted all necessary:

Quote:
<!-- // Start SMS -->
<script language="javascript">
<!-- //char-counter
var formfeld="";
var maxlang=5000;
function recount()
{
if (window.document.smsform.message.value.length>5000)
{
window.document.smsform.message.value=formfeld;
return;
}
else
{
formfeld=window.document.smsform.message.value;
window.document.smsform.showchars.value=maxlang-window.document.smsform.message.value.length;
}
}
//-->
</script>

<form action="/" method="post" name="smsform">


<textarea name="message" onKeyUp="javascript:recount()" rows="5" cols="40" wrap="virtual" style="background-color:black; border-color:848200;" onFocus="this.style.backgroundColor='#840000'" onBlur="this.style.backgroundColor='#000000'">
</textarea> <br>
Chars left: <input type="text" value="5000" name="showchars" size="5"> &nbsp; |&nbsp;
<br>
</form>



(I like the encoder-converter.. yapp)

greetz ed

my Index, Forum and Network54 Tutorials

 
 Respond to this message   
AuthorReply

(Login BilgeRat)

oh, forgot

July 11 2003, 12:15 AM 

to warn you about the ads there...

and try this link the other is only working for registered users
PM-page.. counting chars back...

must go now.. greetz ed

my Index, Forum and Network54 Tutorials

 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

Wow

July 11 2003, 2:05 AM 

Quote:
to warn you about the ads there...
I decided to place your board DNS in my enabled scripting zone... I see what you mean about ads


 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

Re: how many chars left

July 11 2003, 1:37 AM 

Quote:
n54 don't have a name for their post-form, it is an id
I see what you mean but no probs, just replace all accurences of "smsform" with "all".
but saddly won't be able to use the script because there/we cannot include the "onKeyUp" part for the textarea object.

I notice there's no "onMouseUp" only "onKeyUp" included over at that forum, meaning it doesn't count pasted text via the context menu until you use the keyboard again it will then count the pasted text


 
 Respond to this message   

(Login BilgeRat)

Not that easy

July 11 2003, 8:39 AM 

Yes you are right, we have no access to the n54-textarea ( I forgot to add, that should teach me not to do several things at the same time when -I answer postings)
*document.ALL* does not work with Netscape.. the smilies in RapidForum however do fine with Netscape.

OnMouseOut will not do.. for we don't 'touch' the textarea when we insert an icon. I've put (I will put, just working on it) a *onFocus*-command and re-named the onFocus which had changed the color to onMouseDown. That will not make the contex-insert counting.. but.. who care's Now the smilies are countable too, thanks.

greetz ed

my n54 - Links

 
 Respond to this message   
Anonymous
(Login mrpip)
Forum Owner

Re: Not that easy

July 11 2003, 1:34 PM 

Quote:
*document.ALL* does not work with Netscape
Is that right... all the scripts use document.all, wonder if thats ½ the prob... maybe I should look into using the form id instead


 
 Respond to this message   

(Login BilgeRat)

got it working for network 54

July 11 2003, 1:49 PM 

tired to death now.. (3 am)

but it works fine

Chars Counter


you can see it working in the how to forum too..

http://www.network54.com/Hide/Forum/256438"

good night..

my n54 - Links

edit.. it does NOT it won't let you post any more.. have to remove it. sigh...

my n54 - Links


    
This message has been edited by BilgeRat on Jul 11, 2003 1:55 PM


 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

Re: got it working for network 54

July 11 2003, 7:01 PM 

Great page... even a demo... its good to see scripts in action.

I wonder if we're able to asign events to objects that an't accessable


 
 Respond to this message   

(Login BilgeRat)

Good Morning

July 11 2003, 8:42 PM 

this could be an anchor to fix it:
Quote:
<form id="postform" onSelect="javascript:recount()" onKeyUp="javascript:recount()" onFocus="javascript:recount()" onMouseUp="javascript:recount()">



something like

if form id(postform)

could make it... otherwise it kills all network sriptings within the FORM, which it did to my forum after I'd put in my script.


It's a hard nut to crack.. perhaps too hard for me

greetz ed



my n54 - Links

 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

Morning

July 11 2003, 10:01 PM 

Good Morning

Something I've been trying to search for, for the past hour without any luck is wheather you can asign events to objects we have no access to, an example of the top of my head here

such as this 1st part adds an event to the textarea object

<script language="javascript">
postform.message.onkeyup=okeyup
...

then this part will create a function for the new event

<script language="javascript">
<!--
function okeyup(){
...


I wonder.

back to searching the net I go


 
 Respond to this message   
Current Topic - how many chars left
  << Previous Topic | Next Topic >>  
Find more forums on Personal Web PagesCreate your own forum at Network54
 Copyright © 1999-2009 Network54. All rights reserved.   Terms of Use   Privacy Statement