Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-12-2009, 05:38 PM   PM User | #1
markjohnson
New Coder

 
Join Date: Feb 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
markjohnson is an unknown quantity at this point
Prototype: <form> inside a <table> doesn't work

I have been trying Ajax.Request for a form which exists as such:

</tr><form><tr><td></td></tr></form><form><tr> and so on....

I have just discovered that Prototype doesn't support a form interleaved in a table.

The forms must exist outside the table as such:
<form><table><tr>.....</table></form>

..for it to submit the form successfully.

Is there a way around it such that I can use Ajax.Request with the form interleaved in a table?

Thanks in advance!
markjohnson is offline   Reply With Quote
Old 03-12-2009, 05:44 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Code:
</tr><form><tr><td></td></tr></form><form><tr>
Yes, because the above html is pretty invalid. You can't nest a form inside a table like that.
Always validate your markup, when using complex javascript functions.

PS: Check http://www.alistapart.com/articles/p...ccessibleforms to see how to make an accessible form layout.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 03-12-2009, 07:14 PM   PM User | #3
markjohnson
New Coder

 
Join Date: Feb 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
markjohnson is an unknown quantity at this point
I understand that, but how else can I achieve the objective?

I want to make sure that all the columns have the same width. I can do that by making them all fixed-width - that is if I decide to make each tr row into a table (<form><table>). But then, some fields happen to be rather small (depending on the data fetched from the DB) which end up wasting space.
markjohnson is offline   Reply With Quote
Old 03-12-2009, 07:28 PM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
If you really want to nest a form inside a table, it should be placed inside a cell, like
Code:
<table>
<tr>
<td>
<form...........
</form>
</td>
</tr>
<table>
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 03-12-2009, 08:53 PM   PM User | #5
markjohnson
New Coder

 
Join Date: Feb 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
markjohnson is an unknown quantity at this point
I can do that but then the column widths won't be the same.
markjohnson is offline   Reply With Quote
Old 03-13-2009, 07:41 AM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by markjohnson View Post
I can do that but then the column widths won't be the same.
That's why I recommended to check the tutorial to make a semantic and accessible form layout without any tables.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Tags
forms, prototype, table

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:27 PM.


Advertisement
Log in to turn off these ads.