Update a textarea with RJS

Hello

I would like a update a texteara with JS. with this simple code. It’s
working well

RJS
page[“objectif”].value = “test”

View
<%= f.text_area :objectif, :rows => 10 , :cols => 55 , :id =>
“objectif”%>

But when i try to test this code
page[“objectif”].value = page[“textarea”].value

Objectfis Ajouter un document

Objectifs :

<%= f.text_area :objectif, :rows => 10 , :cols => 55 , :id => "objectif"%>

No working. Can you help me

Bolo wrote:

Hello

I would like a update a texteara with JS. with this simple code. It’s
working well

RJS
page[“objectif”].value = “test”

View
<%= f.text_area :objectif, :rows => 10 , :cols => 55 , :id =>
“objectif”%>

But when i try to test this code
page[“objectif”].value = page[“textarea”].value

Objectfis Ajouter un document

Objectifs :

<%= f.text_area :objectif, :rows => 10 , :cols => 55 , :id => "objectif"%>

No working. Can you help me

page[“textarea”].value isn’t a valid value. I am assuming your element
with ID textarea is a select drop down list, then it should be something
like this

page[“objectif”].value =
page[“textarea”].options[page[“textarea”].selectedIndex].value

Hello

i was testing this

@value =
page[“textarea”].options[page[“textarea”].selectedIndex].value

i have an error

[Break on this error] $
(“textarea”).selectedIndex().#<ActionView::Helpers::JavaScriptElementProxy:
0x30…

On Mar 22, 8:50 pm, Wai T. [email protected]