Jump to content

(x)html 'name' attribute


Sniffy
 Share

Recommended Posts

I went throught the (x)html tutorial a bit, and I read that the name attribute is not supported, and that you should use id instead.But what if your using the post form method in PHP?Does PHP recognize the 'id' attribute from the form, or what do I use?

Link to comment
Share on other sites

Not that it's not "supported" but it's "deprecated" in more recent versions (XHTML 1.1). I think PHP recognizes elements by ID. Try it for yourself to be sure. If not, using name is not wrong, as long as you're using XHTML 1.0, not XHTML 1.1.

Link to comment
Share on other sites

This is really a transition period of sorts, it's recommended using both when dealing with forms, because form elements still use the name attribute. The thing is, forms like they are today are, I think, supposed to be replaced by XForms, but that still has some time to go before becoming a standard and supported by all browsers. After html forms are outdated, so will the name attribute.

Link to comment
Share on other sites

Not exactly. It's a completely new specification with it's own new elements ("tag" is not the same as "element"). It is designed to be embedded in all XML based languages for gathering data, taking XHTML and SVG as a priority.

Link to comment
Share on other sites

You can even use it in XHTML 1, after adding the namespace, but there are two problems:1. DTDs are not namespace aware, because they were made for SGML, which doesn't have namespaces. Because of all this, your XHTML will be invalid.2. There aren't many user agents with XForms support. The only one I know is XSmiles. All others requre a plug-in, that is different for each one.In XHTML 2.0, XForms will be added to the core, that is, the DTD, making all XHTML 2 using XForms valid.I really hope for the sake of modular XHTML development, that future specifications, including XHTML 2.0 will be using RelaxNG or better yet- XML Schema to declare the grammer, scince those languages were made specifically for XML. This will enable XHTML files to be valid, even when they use extensions with namespaces.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...