The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Javascript - Accesing text editor

3 posters

Go down

Javascript - Accesing text editor Empty Javascript - Accesing text editor

Post by Light Elf Tue 20 Mar 2012 - 12:05

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
Light Elf
Forumember

Posts : 144
Reputation : 11
Language : English

Back to top Go down

Javascript - Accesing text editor Empty Re: Javascript - Accesing text editor

Post by Mike Tue 20 Mar 2012 - 13:06

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

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Javascript - Accesing text editor Empty Re: Javascript - Accesing text editor

Post by LGforum Tue 20 Mar 2012 - 13:20

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

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Javascript - Accesing text editor Empty Re: Javascript - Accesing text editor

Post by Light Elf Tue 20 Mar 2012 - 15:31

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
Light Elf
Forumember

Posts : 144
Reputation : 11
Language : English

Back to top Go down

Javascript - Accesing text editor Empty Re: Javascript - Accesing text editor

Post by LGforum Tue 20 Mar 2012 - 20:35

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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Back to top


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