Javascript - Accesing text editor

Go down

Javascript - Accesing text editor

Post by Light Elf on Tue Mar 20, 2012 7:05 am

Hi, I'd like to acess textbox where members type messages by javascript. But how to do that? What is the name of form and the name of elelment? I must have those so I can acess first.
avatar
Light Elf
Forumember

Posts : 144
Reputation : 11
Language : English

Back to top Go down

Re: Javascript - Accesing text editor

Post by Mike on Tue Mar 20, 2012 8:06 am

What do you mean by members type messages by javascript? Do you mean a Shoutbox?
avatar
Mike
Hyperactive

Male Posts : 4251
Reputation : 468
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Re: Javascript - Accesing text editor

Post by LGforum on Tue Mar 20, 2012 8:20 am

'document.post' will access the form, 'document.post.message' will access the textbox.
avatar
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Javascript - Accesing text editor

Post by Light Elf on Tue Mar 20, 2012 10:31 am

And when i add this:
Code:
<input type="button" value="Click me" onClick="if(document.post.message.disabled==true)document.post.message.disabled = false
else if(document.post.message.disabled==false) document.post.message.disabled=true"></button>
It doesent work at all. Reply box is not disabled at all.
avatar
Light Elf
Forumember

Posts : 144
Reputation : 11
Language : English

Back to top Go down

Re: Javascript - Accesing text editor

Post by LGforum on Tue Mar 20, 2012 3:35 pm

There's a few issues which I can't really be bothered to explain.

So this should work:
Code:

        <input type="button" value="Click me" onClick="if(document.post.message.disabled){document.post.message.disabled =''}else{document.post.message.disabled='disabled'}"></button>
avatar
LGforum
Hyperactive

Male Posts : 2263
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum