form inside tabular data

View: New views
6 Messages — Rating Filter:   Alert me  

form inside tabular data

by Tei-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am a web author, and I am decide to raise a problem for the
examination of this mail list. I understand the purpose of this mail
list is to discuss changes on the standards, and my problem may need
that.


Problem:

you have lots of tabular data, that use <table> <tr> <td>.
every line on the table is a form

<tr>
<form><td><input type="text" name="price_21" value="5"
/></td><td><input type="submit" value="Change price for product 21"
/></td></form>
</tr>

Ouch!

<tr>
<td><form><input type="text" name="price_21" value="5"
/></td><td><input type="submit" value="Change price for product 21"
/></form></td>
</tr>

Ouch!


Proposed solution:
<tr>
<td><input type="text" form="product_21" name="price_21" value="5"
/></td><td><input type="submit" form="product_21" value="Change price
for product 21" /></td>
</tr>

...

<form id="producto_21"></form>

what?: it take a undefined state ( input widgets living outside form
blocks ) and add a key to attach these orphan widgets to a existing
form.

If theres a prefered solution available, whitin the current standards,
It will be much preferable, but is unknom to me, and to others web
authors asked about the topic.

Theres a alternate solution, that  use javascript,  but I prefered a
html-only solution.


--
--
ℱin del ℳensaje.


Re: form inside tabular data

by David Dorward-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<quote who="Tei">

> you have lots of tabular data, that use <table> <tr> <td>.
> every line on the table is a form
>
> <tr>
> <form><td><input type="text" name="price_21" value="5"
> /></td><td><input type="submit" value="Change price for product 21"
> /></td></form>
> </tr>
>
> Ouch!

It is invalid, but aside from that I see little reason for an "Ouch!". In
this instance, the table looks like it is being used for layout, but I'll
assume that is a simplified example.

> <tr>
> <td><form><input type="text" name="price_21" value="5"
> /></td><td><input type="submit" value="Change price for product 21"
> /></form></td>
> </tr>
>
> Ouch!

This is invalid, but also non-well formed.

> Proposed solution:
> <tr>
> <td><input type="text" form="product_21" name="price_21" value="5"
> /></td><td><input type="submit" form="product_21" value="Change price
> for product 21" /></td>
> </tr>
>
> ...
>
> <form id="producto_21"></form>

Frankly - yuck. I don't see any reason to move the relationship between
forms and form controls from a hierarchy based on one to a attribute
linkage one.

Allowing forms around table rows would (afaik) be backwards compatible
with the error correction in most existing user agents.

> If theres a prefered solution available, whitin the current standards,
> It will be much preferable, but is unknom to me, and to others web
> authors asked about the topic.

One form around the entire table, with the name of the successful submit
button being used to determine which row is being acted upon. (We should
be able to use value, but IE7 and lower have broken implementations of
<button>).

--
David Dorward
http://dorward.me.uk/




Re: form inside tabular data

by Philip TAYLOR (Ret'd) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



David Dorward wrote:

> One form around the entire table, with the name of the successful submit
> button being used to determine which row is being acted upon. (We should
> be able to use value, but IE7 and lower have broken implementations of
> <button>).

But the original question was how to have multiple forms
within a single table (one per row), not how to be able
to differentiate from within which row a particular
"Submit" operation took place.

I agree with your earlier analysis that permitting
<form> to appear within <tr> is the most appropriate
solution.

Philip TAYLOR


Re: form inside tabular data

by Octavio Alvarez Piza :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 18 May 2009 04:42:56 -0700, Philip TAYLOR (Ret'd) <P.Taylor@...> wrote:

> David Dorward wrote:
>
>> One form around the entire table, with the name of the successful submit
>> button being used to determine which row is being acted upon. (We should
>> be able to use value, but IE7 and lower have broken implementations of
>> <button>).
>
> But the original question was how to have multiple forms
> within a single table (one per row), not how to be able
> to differentiate from within which row a particular
> "Submit" operation took place.

Why would you need to have multiple forms (read: multiple forms with
different actions each), one per row, given that properly tabulated
data should be similar in type?



Re: form inside tabular data

by Philip TAYLOR (Ret'd) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Octavio Alvarez wrote:

 > Why would you need to have multiple forms (read: multiple forms with
 > different actions each), one per row, given that properly tabulated
 > data should be similar in type?

That is not for me to say.  I was simply pointing out that David's
proposal did not address the problem.

Philip TAYLOR


Re: form inside tabular data

by Tei-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Tue, May 19, 2009 at 6:53 AM, Octavio Alvarez <alvarezp@...> wrote:
On Mon, 18 May 2009 04:42:56 -0700, Philip TAYLOR (Ret'd) <P.Taylor@...> wrote:

> David Dorward wrote:
>
>> One form around the entire table, with the name of the successful submit
>> button being used to determine which row is being acted upon. (We should
>> be able to use value, but IE7 and lower have broken implementations of
>> <button>).
>
> But the original question was how to have multiple forms
> within a single table (one per row), not how to be able
> to differentiate from within which row a particular
> "Submit" operation took place.

Why would you need to have multiple forms (read: multiple forms with
different actions each), one per row, given that properly tabulated
data should be similar in type?

so you suggest to use a single form, and differentiate the data, based on the submit?

<form action="emailgestor.php">
<table>
<tr>
<td><input type="checkbox" name="email_1"> favorite</td><td>Re: forms</td><td><input type="submit" name="reply_1" value="Reply"><input type="submit" name="delete_1" name="Delete"></td>
</tr>

.
.
.
.
<tr>
<td><input type="checkbox" name="email_30"> favorite</td><td>Re: looks mom, no hands</td><td><input type="submit" name="reply_30" value="Reply"></td><td><input type="submit" name="delete_30" name="Delete"></td>
</tr>
</table>
</form>


On the server:


for($t=1;$t<=$maxemails;$t++){  
   if (isset ( $_POST["reply_" . $t] ) ) {
           replyEmail($t);
   } else  if (isset( $_POST["delete_". $t] )  ) {
          deleteEmail($t);
  }
  if (isset( $_POST["delete_". $t] )  &&  $_POST["delete_". $t]  == "on" ) {
          favoriteEmail($t, true);
  }  else {
         favoriteEmail($t,false);
  }
}

humm... maybe this work.


--
--
ℱin del ℳensaje.