Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Validation Problem

Featured Replies

Hi people,

 

I have all pages but one validating on this website, and I can't for the life of me work out what the w3c error msgs are trying to tell me?

 

Has anyone got any ideas?

 

Cheers

 

Rich

Because you're using xhtml strict you need to have a space before the forward slash on self closing elements.

For example, change this:

<input type="submit" name="submit" value="Your Price" class="submit"/>

		<input type="hidden" name="submitted" value="TRUE"/>

to this

<input type="submit" name="submit" value="Your Price" class="submit" />

		<input type="hidden" name="submitted" value="TRUE" />

  • Author

Thanks for the tip but that doesn't seem to have solved it. I don't think that space is actually a requirement as such for XHTML.

 

I just can't work out what is causing the error! I've checked my opening and closing elements, they appear to be fine...

Hi scaz,

 

You need to wrap the inside of your form with a <fieldset> — that will solve your issue :)

  • Author

Ahh that worked, thanks!

 

I never knew <fieldset> was a required element of a form? I'm almost certain I have other forms validating on other websites without it?

It's most definitely a requirement if you're using XHTML strict.

Ah, but you've contained all your input elements within <p> tags. My previous statement was a little off (sorry!), it doesn't have to be contained inside a fieldset. I believe you can also contain your form elements in something like a <p>, it's just more semantically correct to have a fieldset in there anyway.

  • Author

ah that makes sense, well spotted.

 

Cheers

  • Author
Hey on your blog did you get that IE Graph off my blog?? JakeBoyles.com Im j/w

 

What kip said ^, I can't remember who's blog it was off.

Because you're using xhtml strict you need to have a space before the forward slash on self closing elements.

For example, change this:

<input type="submit" name="submit" value="Your Price" class="submit"/>

		 <input type="hidden" name="submitted" value="TRUE"/>

to this

<input type="submit" name="submit" value="Your Price" class="submit" />

		 <input type="hidden" name="submitted" value="TRUE" />

The extra space isn't required by XHTML. It's there only to make XHTML more compatible with older HTML browsers. Ideally it should not be there.

Ahh that worked, thanks!

 

I never knew <fieldset> was a required element of a form? I'm almost certain I have other forms validating on other websites without it?

 

The basic funda is you have to embed the input field inside a block-level element, if you embed that inside an inline element you will get an error too.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.