The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Javascript - Accesing text editor

View previous topic View next topic Go down

Javascript - Accesing text editor

Post by Light Elf on March 20th 2012, 12:05 pm

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.

Light Elf
Forumember

Posts : 144
Reputation : 11
Language : English

Back to top Go down

Re: Javascript - Accesing text editor

Post by Mike on March 20th 2012, 1:06 pm

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

Mike
Hyperactive

Male Posts : 4242
Reputation : 466
Language : English, HTML, CSS
Location : Bozeman, Montana

Back to top Go down

Re: Javascript - Accesing text editor

Post by LGforum on March 20th 2012, 1:20 pm

'document.post' will access the form, 'document.post.message' will access the textbox.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: Javascript - Accesing text editor

Post by Light Elf on March 20th 2012, 3:31 pm

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.

Light Elf
Forumember

Posts : 144
Reputation : 11
Language : English

Back to top Go down

Re: Javascript - Accesing text editor

Post by LGforum on March 20th 2012, 8: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>

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

View previous topic View next topic Back to top


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