Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   Form in one row of table (http://www.velocityreviews.com/forums/t162285-form-in-one-row-of-table.html)

Krycek 07-24-2005 02:46 PM

Form in one row of table
 
I want to create form that will take one row of a table. I use it with PHP
script whith taking data from database and should create something like
this:

<table>
<tr><th>Col name1</th><th>Col name2</th><th>Col
name3</th><th>Options</th></tr>
<!-- First row -->
<form><tr><td><input ... /></td><td><input ... /></td><td><input ...
/></td><td><input type="submit" name="action" value="Save" /><input
type="submit" name="action" value="Delete" /></td></tr></form>
<!-- Second row -->
<form><tr><td><input ... /></td><td><input ... /></td><td><input ...
/></td><td><input type="submit" name="action" value="Save" /><input
type="submit" name="action" value="Delete" /></td></tr></form>

....
</table>

But when I generate code like above Opera adds break line before table for
every </form> tag so if I have a lot of rows table isn't in top of page.
Also code like above is not valid HTML 4.01 Transitional (acording to W3
org validator).
When I delete </form> tag from source everything is ok (but of course code
still is not valid).

Does enyone know how I should resolve that problem? It is important to me
to generate valid HTML 4.01 Transitional code.

Thanx for help.

--
krycek6@wp.pl

Jedi Fans 07-24-2005 02:59 PM

Re: Form in one row of table
 
Krycek wrote:
> I want to create form that will take one row of a table. I use it with
> PHP script whith taking data from database and should create something
> like this:
>
> <table>
> <tr><th>Col name1</th><th>Col name2</th><th>Col
> name3</th><th>Options</th></tr>
> <!-- First row -->
> <form><tr><td><input ... /></td><td><input ... /></td><td><input ...
> /></td><td><input type="submit" name="action" value="Save" /><input
> type="submit" name="action" value="Delete" /></td></tr></form>
> <!-- Second row -->
> <form><tr><td><input ... /></td><td><input ... /></td><td><input ...
> /></td><td><input type="submit" name="action" value="Save" /><input
> type="submit" name="action" value="Delete" /></td></tr></form>
>
> ...
> </table>
>
> But when I generate code like above Opera adds break line before table
> for every </form> tag so if I have a lot of rows table isn't in top of
> page. Also code like above is not valid HTML 4.01 Transitional
> (acording to W3 org validator).
> When I delete </form> tag from source everything is ok (but of course
> code still is not valid).
>
> Does enyone know how I should resolve that problem? It is important to
> me to generate valid HTML 4.01 Transitional code.
>
> Thanx for help.
>

<style type="text/css"><!--
form{margin:0;}
//--></style>

Steve Pugh 07-24-2005 03:24 PM

Re: Form in one row of table
 
Krycek <krycek6@wp.pl> wrote:

>I want to create form that will take one row of a table. I use it with PHP
>script whith taking data from database and should create something like
>this:
>
><!-- First row -->
><form><tr><td><input ... /></td><td><input ... /></td><td><input ...
>/></td><td><input type="submit" name="action" value="Save" /><input
>type="submit" name="action" value="Delete" /></td></tr></form>
>
>But when I generate code like above Opera adds break line before table for
>every </form> tag so if I have a lot of rows table isn't in top of page.
>Also code like above is not valid HTML 4.01 Transitional (acording to W3
>org validator).
>When I delete </form> tag from source everything is ok (but of course code
>still is not valid).
>
>Does enyone know how I should resolve that problem? It is important to me
>to generate valid HTML 4.01 Transitional code.


Use one single form around the whole table and modify the script on
the server that receives the form input accordingly.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>

Steve Pugh 07-24-2005 03:26 PM

Re: Form in one row of table
 
Jedi Fans <"news[at]jedifans[--=dot==-]com"> wrote:
>Krycek wrote:
>>
>> Does enyone know how I should resolve that problem? It is important to
>> me to generate valid HTML 4.01 Transitional code.
>>

><style type="text/css"><!--
>form{margin:0;}
>//--></style>


Do you really think that this will make the code valid HTML 4.01? And
do you really think that the HTML comments are needed? And why on
earth include the JavaScript style comment on the last line?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>

Krycek 07-24-2005 03:28 PM

Re: Form in one row of table
 
Dnia Sun, 24 Jul 2005 16:59:16 +0200, Jedi Fans
<"news[at]jedifans[--=dot==-]com"> napisał:

> <style type="text/css"><!--
> form{margin:0;}
> //--></style>



Thanks. It works = removes break lines. But code is still invalid becouse
<form> can't be nested in <table> withouth <TD>.

Anyway - Thank You - half of my problem is resolved.

--
krycek

Krycek 07-24-2005 03:52 PM

Re: Form in one row of table
 
Dnia Sun, 24 Jul 2005 17:24:45 +0200, Steve Pugh <steve@pugh.net> napisał:

>
> Use one single form around the whole table and modify the script on
> the server that receives the form input accordingly.
>
> Steve
>


It is some solution... but table will be big and sending each time all
data from it to server and back seems waste time of user which browsing
the page. Of course I could use JavaScript to reduce it but it make page
vulnerable for user agent.

If I wan't have a choice I will do like You say.

Thanks for help anyway.

--

Jonathan N. Little 07-24-2005 03:53 PM

Re: Form in one row of table
 
Krycek wrote:

> Thanks. It works = removes break lines. But code is still invalid
> becouse <form> can't be nested in <table> withouth <TD>.


Correct, you cannot put FORM tag between TABLE and TR. Entire FORM can
go within a TD pair or encompass the entire TABLE. I think what you are
trying to do the latter is your course. Make a separate table for each form.

<!-- 1st Row -->
<form><table><tr><td> ... </td> ... <td> ... </td></tr></table></form>
..
..
..
<!-- nth Row -->
<form><table><tr><td> ... </td> ... <td> ... </td></tr></table></form>

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Krycek 07-24-2005 04:33 PM

Re: Form in one row of table
 
Dnia Sun, 24 Jul 2005 17:53:52 +0200, Jonathan N. Little
<lws4art@centralva.net> napisał:

> Krycek wrote:
>
>> Thanks. It works = removes break lines. But code is still invalid
>> becouse <form> can't be nested in <table> withouth <TD>.

>
> Correct, you cannot put FORM tag between TABLE and TR. Entire FORM can
> go within a TD pair or encompass the entire TABLE. I think what you are
> trying to do the latter is your course. Make a separate table for each
> form.
>
> <!-- 1st Row -->
> <form><table><tr><td> ... </td> ... <td> ... </td></tr></table></form>
> .
> .
> .
> <!-- nth Row -->
> <form><table><tr><td> ... </td> ... <td> ... </td></tr></table></form>
>


Yes - I thought about it but result of this solution is that I can't
guarantee that widths of cells in the same column and other
"rows" (in quote becouse it is separate table now) will be the same. Even
if I write them explicite if content of cell is bigger then only that cell
grow not all "column" (in quote due to same reason as above ;) ).

But thank You very much for proposal of solution.

--
krycek

Jeff Thies 07-24-2005 04:55 PM

Re: Form in one row of table
 
Krycek wrote:

> Dnia Sun, 24 Jul 2005 17:24:45 +0200, Steve Pugh <steve@pugh.net> napisał:
>
>>
>> Use one single form around the whole table and modify the script on
>> the server that receives the form input accordingly.
>>
>> Steve
>>

>
> It is some solution... but table will be big and sending each time all
> data from it to server and back seems waste time of user which browsing
> the page.


Maybe you need to rethink your architecture. Don't worry so much about
server time (after all you are still loading the whole table, the amount
of data sent to the server is a fraction of that). Think about ease of
use for your client. You could easily rewrite this so it makes the whole
form editable so your clients don't have to edit a single row at a time.
Editing several rows that way is a drag.

Jeff


Of course I could use JavaScript to reduce it but it make
> page vulnerable for user agent.
>
> If I wan't have a choice I will do like You say.
>
> Thanks for help anyway.
>



All times are GMT. The time now is 05:58 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.