text directly the <form> element violates the rules of xhtml

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

What does it mean when a text say "adding text directly inside the <form>
element violates the rules of xhtml.
Here I have some code and it's no problem to add a static text like Testing
inside the form tag like I have done here.
So axactly what does it mean what a text say "adding text directly inside
the <form> element violates the rules of xhtml"

<form id="form1" runat="server">
Testing
<div>
<asp:Button ID="cmd" style="POSITION: absolute; left:150px;
top:61px;"
runat="server" Text="Button" />
</div>
<asp:Label ID="Label1" runat="server" Text="testing"></asp:Label>
</form>

//Tony
 
What does it mean when a text say "adding text directly inside the<form>
element violates the rules of xhtml.
Here I have some code and it's no problem to add a static text like Testing
inside the form tag like I have done here.
So axactly what does it mean what a text say "adding text directly inside
the<form> element violates the rules of xhtml"

<form id="form1" runat="server">
Testing
<div>
<asp:Button ID="cmd" style="POSITION: absolute; left:150px;
top:61px;"
runat="server" Text="Button" />
</div>
<asp:Label ID="Label1" runat="server" Text="testing"></asp:Label>
</form>

As far as I can see then it is well formed XML.

I don't know XHTML good enough to say whether it should validate
as XHTML.

I would suggest writing it like:

<form id="form1" runat="server">
<p>Testing</p>
<div>
<asp:Button ID="cmd" style="POSITION: absolute; left:150px;
top:61px;"
runat="server" Text="Button" />
</div>
<asp:Label ID="Label1" runat="server" Text="testing"></asp:Label>
</form>

Arne
 
Back
Top