Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Form in one row of table

Reply
Thread Tools

Form in one row of table

 
 
Krycek
Guest
Posts: n/a
 
      07-24-2005
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.

--
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Jedi Fans
Guest
Posts: n/a
 
      07-24-2005
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>
 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      07-24-2005
Krycek <(E-Mail Removed)> 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 <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      07-24-2005
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 <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
Krycek
Guest
Posts: n/a
 
      07-24-2005
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
 
Reply With Quote
 
Krycek
Guest
Posts: n/a
 
      07-24-2005
Dnia Sun, 24 Jul 2005 17:24:45 +0200, Steve Pugh <(E-Mail Removed)> 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.

--
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      07-24-2005
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
 
Reply With Quote
 
Krycek
Guest
Posts: n/a
 
      07-24-2005
Dnia Sun, 24 Jul 2005 17:53:52 +0200, Jonathan N. Little
<(E-Mail Removed)> 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
 
Reply With Quote
 
Jeff Thies
Guest
Posts: n/a
 
      07-24-2005
Krycek wrote:

> Dnia Sun, 24 Jul 2005 17:24:45 +0200, Steve Pugh <(E-Mail Removed)> 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.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
row bottom border in inner table not matching up with row border in outer table phl HTML 1 06-08-2006 03:43 PM
ie6 Insert Row at specific Row Index of Table Giggle Girl Javascript 18 02-07-2006 07:54 AM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
My addnew row button is only adding one row? Luis Esteban Valencia ASP .Net 0 03-23-2005 04:03 PM
Can center row in three row table take up remaining space? Anon HTML 2 03-18-2005 08:35 AM



Advertisments