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

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
 
A

Arne Vajhøj

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top