9 Replies - 1038 Views - Last Post: 13 May 2011 - 08:27 AM

#1 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 795
  • View blog
  • Posts: 1,681
  • Joined: 30-January 09

Input tags, HTML vs XHTML

Posted 13 May 2011 - 12:00 AM

This thread is a follow-on from this thread about forms in the PHP forum.

<input> is valid HTML, invalid XHTML
<input/> is invalid HTML, valid XHTML

Why then are most pages served in HTML, have input end tags, and yet still render? (DIC is an example) It seems to be the code equivalent of "jaywalking is a crime".

Is This A Good Question/Topic? 0
  • +

Replies To: Input tags, HTML vs XHTML

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3515
  • View blog
  • Posts: 10,140
  • Joined: 08-June 10

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 01:10 AM

HTML parsers are very forigiving when it comes to rendering HTML code. that’s because HTML parsers must be backwards compatible and thus allow beginners to write web sites (mind that the absolute minority of website creators are professionals).

XHTML has been the attempt of the W3C to force the coding of valid HTML code, which failed due to the lacking browser support (for a good part).

additionally, XML (and thus XHTML) is often read by machines (programmes) that need valid code to work correctly.

This post has been edited by Dormilich: 13 May 2011 - 01:12 AM

Was This Post Helpful? 2
  • +
  • -

#3 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 795
  • View blog
  • Posts: 1,681
  • Joined: 30-January 09

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 01:35 AM

Hmm, right, got it. I think ;)

I was under the impression that XHTML was the direction that web standards were moving in, but now that I've read a few articles / opinions round the net it seems apparent that HTML is the way to go.

Interesting that W3C were moving towards XHTML, but then the WHATWG consortium spearheaded a push for HTML5 and W3C gave in. This I did not know :)

This post has been edited by e_i_pi: 13 May 2011 - 01:36 AM

Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3515
  • View blog
  • Posts: 10,140
  • Joined: 08-June 10

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 01:49 AM

View Poste_i_pi, on 13 May 2011 - 10:35 AM, said:

Interesting that W3C were moving towards XHTML, but then the WHATWG consortium spearheaded a push for HTML5 and W3C gave in.

itís not that simple. WHATWG initially meant to update HTMLís form capabilities without taking the route XForms were going (XML based form handling). the lack of support for XHTML (thanks, IE) and of course the different meanings about error handling as well as the progress towards the semantic web (Microformats, WAI-ARIA, etc.) then lead to the development of HTML5 and cancellation of XHTML 2.0. as a sidenote I have to mention that there is also XHTML5 (the XML variant of HTML5).

PS. HTML5 requires the browser vendors to develop yet another parser.
Was This Post Helpful? 1
  • +
  • -

#5 EnvXOwner  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 357
  • View blog
  • Posts: 2,319
  • Joined: 10-August 09

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 04:10 AM

So if you're using HTML a form control could look like: <input type="text" name="name" placeholder="name">? Would that mean that you would do <br> instead of <br /> in HTML? I never looked up the different in HTML and XHTML, or XML.

This post has been edited by EnvXOwner: 13 May 2011 - 04:10 AM

Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3515
  • View blog
  • Posts: 10,140
  • Joined: 08-June 10

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 04:13 AM

View PostEnvXOwner, on 13 May 2011 - 01:10 PM, said:

So if you're using HTML a form control could look like: <input type="text" name="name" placeholder="name">? Would that mean that you would do <br> instead of <br /> in HTML?

yes.
Was This Post Helpful? 0
  • +
  • -

#7 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 726
  • View blog
  • Posts: 8,638
  • Joined: 14-September 07

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 06:59 AM

I always tried to code XHTML, even use the XHTML Transitional/Strict doctype's till this day by default.

The direction HTML is moving in is HTML5 - it is gaining major headway, browser support is continually improving and life is just getting better for us in the industry. IE6 is on life support and fading fast. IE7 pisses me off.

Welcome to the world of web development.

Also a good resource for you to look into is the 1140 grid system. http://cssgrid.net

With everything moving mobile, this grid system allows for media queries and adjusts accordingly.

This post has been edited by Nykc: 13 May 2011 - 07:01 AM

Was This Post Helpful? 1
  • +
  • -

#8 crownRoyal89  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 47
  • Joined: 10-May 11

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 07:40 AM

View PostDormilich, on 13 May 2011 - 01:10 AM, said:

HTML parsers are very forigiving when it comes to rendering HTML code. thatís because HTML parsers must be backwards compatible and thus allow beginners to write web sites (mind that the absolute minority of website creators are professionals).

XHTML has been the attempt of the W3C to force the coding of valid HTML code, which failed due to the lacking browser support (for a good part).


I agree. HTML is meant to be used as a very basic approach to creating websites. Which is often used by new programmers/ beginners. Even if the HTML code is poorly written most web browsers a very forgiving and still display what is "implied" by the coder.

I actually just finished a class on CSS and XHTML; Now thinking about moving forward to other web development languages. Any suggestions to what my next challenge should be?
Was This Post Helpful? 1
  • +
  • -

#9 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 726
  • View blog
  • Posts: 8,638
  • Joined: 14-September 07

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 08:19 AM

Javascript/JQuery
Then Look into a server side language like PHP, Ruby then the framework /RoR
Was This Post Helpful? 1
  • +
  • -

#10 crownRoyal89  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 47
  • Joined: 10-May 11

Re: Input tags, HTML vs XHTML

Posted 13 May 2011 - 08:27 AM

I'm looking into PHP as we speak. Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1