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. Advertisements

  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. Advertisements

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. Rod  Snyder

    moving from form element to form element

    Rod Snyder, May 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    538
    Vidar Petursson
    May 29, 2004
  2. Kent Paul Dolan
    Replies:
    22
    Views:
    1,410
    goergebush
    Dec 22, 2005
  3. Replies:
    7
    Views:
    1,197
  4. Replies:
    2
    Views:
    764
  5. sk
    Replies:
    0
    Views:
    2,482
  6. HANM
    Replies:
    2
    Views:
    1,527
    Joseph Kesselman
    Jan 29, 2008
  7. Fedor Rodikov
    Replies:
    6
    Views:
    909
    James Kanze
    Sep 2, 2011
  8. Phlip
    Replies:
    8
    Views:
    322
    David A. Black
    Aug 22, 2004
Loading...