Adrie Donker
2008-Mar-23 18:14 UTC
JS inserted inputs don’t appear as parameters in controller
I''ve read ''How to get dynamically created inputs from html form back to, Posted by David Johnson (Guest) on 03.06.2006 04:03'' but it doesn''t seem to work for me. I''m using client-side javascript to add input tags to a webpage, but when I submit the page, there are no parameters created for the input fields, when it is entering the controller???? The code in the .js file: function addBmw(){ cnt = $(''bmws'').select(''div[id^=bmw]'').size(); bmw = $F(''sel_bmw'').split(''|''); bmw_line = ''<div id="'' + ''bmw'' + (cnt).toString() + ''">''; bmw_line += '' <img alt="delete" border="0px" src="/images/delete-icon.jpg" onclick="javascript:delBmw('' + (cnt).toString() + '')" />''; bmw_line += ''<input style="position:relative;left:200px" id="event_employer_'' + bmw[0] + ''_xomment" name="event_employer['' + bmw[0] + ''][comment]" size="60" type="text" />''; bmw_line += ''<label style="position:relative;left:-380px"> '' + bmw[1] + ''</label>''; bmw_line += ''</div>''; Element.insert(''bmws'', {bottom: bmw_line}); } function delBmw(bmw_id){ Element.remove(''bmw'' + bmw_id) } This works fine on the page, but no parameters received in the controller ..... Someone knows an answer? (or is it just working as designed?) TIA, Adrie -- 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 -~----------~----~----~----~------~----~------~--~---