Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6529325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:37:22+00:00 2026-05-25T09:37:22+00:00

In my Grails app, I have a GSP with the following markup: <p class=’foo’>

  • 0

In my Grails app, I have a GSP with the following markup:

<p class='foo'>
  <label>Email</label>
  <g:textField id="email" name="email" class="field required email"
      title="Please enter a valid email address" maxlength="50" value="${signUp?.email}"/>
  <g:eachError bean="${signUp}" field="email">
    <div class="fieldError"><g:message error="${it}"/></div>
  </g:eachError>
</p>

<label>Your Age:</label>

When the email field has an error, this generates the following HTML:

<p class="foo">
  <label style="width: 100px;">Email</label>
  <input id="email" class="field required email" type="text" value="" maxlength="50" title="Please enter a valid email address" name="email" style="width: 275px;">
</p>
<div class="fieldError" style="margin-left: 155px;">No email was provided</div>
<p></p>
<label style="width: 100px; vertical-align:middle;">Your Age:</label>

I can’t figure out:

  • why <div class="fieldError> appears outside <p class='foo'>
  • where is <p></p> coming from?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:37:23+00:00Added an answer on May 25, 2026 at 9:37 am

    <p> elements don’t allow block level elements inside them, so that’s why <div class="fieldError> is outside <p class='foo'>.

    I’m not sure why you have an extra p tag below the first one. Can you post the generated HTML when you just use pure HTML?


    A quick experiment shows that nested block elements mysteriously generate another <p> tag in FF6, Chrome 13 and Opera 11.51

    This is the typed code:

    <p>
        P
        <div>
            DIV1
            <div>
                DIV1a
            </div>
        </div>
    </p>
    

    And this is the output:

    <p>P</p>
    <div>
        DIV1
        <div>
            DIV1a
        </div>
    </div>
    <p></p>
    

    It appears that each block level element (here a <div>) is pushed out of any <p> tags, and creates another <p> tag underneath it.

    From the specification:

    The P element represents a paragraph. It cannot contain block-level
    elements (including P itself).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to implement map values in my Grails app. I have a class
I have a grails app with a domain Restaurant and a domain Person. class
I have a variable in my Grails app’s BootStrap.groovy : class BootStrap { def
I have POJO domain class in Grails/PostgreSql app and I'm trying to map postgres
I have a Grails app that loads its data from xml files and delivers
I have upgraded my grails app from 1.3.7 to 2.0.1. I had few static
I have inherited a Grails app, which uses the Acegi 0.5.3 plugin. The application
I have a page X in my grails app which has a button to
I am writing a Grails/Groovy app and I have a JSON object with a
I'm developing a Grails App. I have about 20 Controllers right now and there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.