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

Discussion in 'ASP .Net' started by Tony Johansson, Jul 17, 2011.

  1. 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
     
    Tony Johansson, Jul 17, 2011
    #1
    1. Advertising

  2. Tony Johansson

    Arne Vajhøj Guest

    On 7/16/2011 8:22 PM, Tony Johansson wrote:
    > 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
     
    Arne Vajhøj, Jul 17, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kent Paul Dolan
    Replies:
    22
    Views:
    1,142
    goergebush
    Dec 22, 2005
  2. sk
    Replies:
    0
    Views:
    2,283
  3. HANM
    Replies:
    2
    Views:
    723
    Joseph Kesselman
    Jan 29, 2008
  4. Fedor Rodikov
    Replies:
    6
    Views:
    680
    James Kanze
    Sep 2, 2011
  5. Phlip
    Replies:
    8
    Views:
    182
    David A. Black
    Aug 22, 2004
Loading...

Share This Page