Forum Moderators: open

Message Too Old, No Replies

form won't validate in a div

required attribute "ACTION" not specified.

         

Lorel

6:52 pm on Jul 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



my form won't validate and after doing research I realize it's because it was in a Table. So I changed the table to a Div. I have a border around the whole outside of the page controlled by a div but that won't validate either because the form's inside the div. I can't move it outside the div or it will ruin the design on affected pages.

Is there anything else I can do.

Receptional Andy

7:23 pm on Jul 3, 2008 (gmt 0)



There's no problem with putting a form inside a div, but if the error posted in the description is the problem ("required attribute "ACTION" not specified") this simply means that you can't have a form that leads nowhere: i.e. you need a target within an action attribute:

<form action="/target">

If the form is only submittable via javascript, then a workaround would be set the action to "#".

tedster

8:43 pm on Jul 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, apparently the issue here is the action attribute. But in a strict DTD, there can also be validation issues from having a form within a table element. A form element is valid if it completely contains the table element, or if it's contained within a table cell. But the following kind of thing is not valid

<table>
<form>
<tr><td></td></tr>
</form>
</table>

Receptional Andy

8:46 pm on Jul 3, 2008 (gmt 0)



As a footnote to that (but probably off topic!), you can get a lot of flexibility with form layout by simply using the fieldset, legend, and label tags + a bit of CSS, which also help to make forms more accessible.

Lorel

10:51 pm on Jul 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




The form is not run by Javascript.

I use 4.01 transitional Doc type.

I have a table inside of the form tag(s).

There is no table outside the form tags

and there is an action tag on the Form tag:

<form method="post" action="http://www.example.com/cgi-bin/formmail/FormMail.pl">

encyclo

11:59 pm on Jul 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your page should validate as long as the nesting is correct - but the missing
action
attribute error doesn't make much sense in the context you describe. There's no reason why a
form
can't be inside a
div
, just that the form elements must themselves be inside another
div
or
table
.

Could you post some code as you have it at the moment?