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 <select id="textara" name="textara" style="margin-left: 30px;"> <option value="objectif">Objectfis</option> </select> <a href="#" id="add_doc"> <img src="../images/add.gif" alt="Ajouter un document" style="border: 0; margin-left: 50px; vertical-align: middle;"> </a> </div> <h3>Objectifs :</h3><%= f.text_area :objectif, :rows => 10 , :cols => 55 , :id => "objectif"%> No working. Can you help me --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 > > <select id="textara" name="textara" style="margin-left: 30px;"> > <option value="objectif">Objectfis</option> > </select> > <a href="#" id="add_doc"> > <img src="../images/add.gif" alt="Ajouter un document" > style="border: > 0; margin-left: 50px; vertical-align: middle;"> > </a> > </div> > <h3>Objectifs :</h3><%= f.text_area :objectif, :rows => 10 , :cols => > 55 , :id => "objectif"%> > > No working. Can you help mepage["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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Tsang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 > > > <select id="textara" name="textara" style="margin-left: 30px;"> > > <option value="objectif">Objectfis</option> > > </select> > > <a href="#" id="add_doc"> > > <img src="../images/add.gif" alt="Ajouter un document" > > style="border: > > 0; margin-left: 50px; vertical-align: middle;"> > > </a> > > </div> > > <h3>Objectifs :</h3><%= 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 > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---