I''m trying to update a table cell based upon a selection in another
cell
identified as "descPlaceholder". However, instead of getting the
intended cell updated the updated string gets displayed completely
outside of the table in a seemingly arbitrary spot on the form.
The form:
<table>
<tr>
<th>Code</th>
<th>Name</th>
<th>Quantity</th>
</tr>
<tr>
<td>
<%= select_tag :partcode,
options_from_collection_for_select(@parts, ''id'',
''code'')
%>
<%= observe_field(:partcode,
:update => :descPlaceholder,
:url => {:action => :getPartName})
%>
</td>
<div id="descPlaceholder">
<td>placeholder for description</td>
</div>
<td>
<%= text_field "partquantity", "quantity", :size
=>5, :maxlength
=>5 %>
</td>
</tr>
</table>
getPartName.html.erb:
<td>Test Description</td>
getPartName method:
def
end
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Jul 28, 2010 at 8:30 AM, Tomasz Romanowski <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''m trying to update a table cell based upon a selection in another cell > identified as "descPlaceholder". However, instead of getting the > intended cell updated the updated string gets displayed completely > outside of the table in a seemingly arbitrary spot on the form.> </td> > <div id="descPlaceholder"> > <td>placeholder for description</td> > </div> > <td>That''ll never work because it''s not valid HTML; a DIV can''t be a child of a TR. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You can alwaus just do the following: <td id="descPlaceholder"> -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Eric Yen wrote:> You can alwaus just do the following: > > <td id="descPlaceholder">Wow, many thanks to both of you! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.