Forum: Ruby on Rails AJAX to a table row

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ff43001ac5fe9805aa6ca2e89d3b7b5d?d=identicon&s=25 Jake Janovetz (janovetz)
on 2006-02-12 20:15
Hello-

I'd like to throw a little AJAX into a table to allow the user to edit a
single row of data inline rather than moving to another page.

The row (which has N columns) would be swapped out for a row which has a
single column (colspan="N") and the form inputs would be in that row.

My question is, is this legal HTML?  I can't find anything that says
either way.  Basically, I'm thinking the HTML would look like:

...
<tr><div id="item_43">
  <td>blah</td>
  <td>blah</td>
</div></tr>

<tr><div id="item_44">
  <td>blah</td>
  <td>blah</td>
</div></tr>
...

During the AJAX call, "item_44" would get replaced with something like:

<td colspan="2">...Edit Blah...</td>

Is this ok?

   Jake
Ac1da5d66d51a1c3b843221032247b30?d=identicon&s=25 Eric Goodwin (Guest)
on 2006-02-12 20:56
(Received via mailing list)
Hi Jake,

Just add the id to the <tr> .... so

<tr id="item_43">
    <td>Whatever</td>
    <td>Whatever</td>
</tr>

You should not use <div>'s when you don't need to. Always try to use a
already existing tag before resorting to a div.

Eric

Jake Janovetz wrote:

>
>...
>
--
Eric Goodwin
ericgoodwin.com
828dc634f7493008dbc96c437e54ea2f?d=identicon&s=25 Chris Scharf (scharfie)
on 2006-02-12 21:29
Eric Goodwin wrote:
> Hi Jake,
>
> Just add the id to the <tr> .... so
>
> <tr id="item_43">
>     <td>Whatever</td>
>     <td>Whatever</td>
> </tr>
>
> You should not use <div>'s when you don't need to. Always try to use a
> already existing tag before resorting to a div.
>
> Eric
>
> Jake Janovetz wrote:
>
>>
>>...
>>
> --
> Eric Goodwin
> ericgoodwin.com

Also, for the record, adding a div inside a tr directly is against XHTML
standard
(http://learningforlife.fsu.edu/webmaster/reference...).
Ff43001ac5fe9805aa6ca2e89d3b7b5d?d=identicon&s=25 Jake Janovetz (janovetz)
on 2006-02-12 22:01
> Also, for the record, adding a div inside a tr directly is against XHTML
> standard
> (http://learningforlife.fsu.edu/webmaster/reference...).

Thanks.  This is what I was after.  Though, for this particular case,
the ID'ed <TR> will work just fine.

Thanks!

   Jake
This topic is locked and can not be replied to.