Re: [WSG] input name and id
On 18/04/2007, at 1:56 PM, Mariusz Nowak wrote: 'name' is not required by specification (at least as far as I understand specification) - it's a bit striking to me as what's the use of input element without assigned name?? Exactly. Perhaps I should have said 'name' is **needed** to process form controls and avoided language with special meaning within the spec. see: http://www.w3.org/TR/html401/interact/forms.html#successful- controls kind regards Terrence Wood. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] input name and id
On 16/04/07, Nick Fitzsimons [EMAIL PROTECTED] wrote: Name and ID serve two different purposes. ID is used to identify the element's node in the document [1]. Name is used to identify the element's value in the form submission posted back to the server [2]. OTOH, according to the HTML 4.01 Strict DTD, name is #IMPLIED, not #REQUIRED, so the book is incorrect. [3] The book is correct. It's a question of HTML having rules that DTD can't represent. In this case, that input elements can be form controls or form functionality (i.e. type attribute has a value of submit or reset). The name attribute is required on form controls but not on form functionality. The DTD format doesn't allow this type of granularity however. In other words, just because something is valid according to the HTML DTD doesn't mean it's valid according to the HTML specification. -- David liorean Andersson *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] input name and id
On 19 Apr 2007, at 12:03:22, liorean wrote: On 16/04/07, Nick Fitzsimons [EMAIL PROTECTED] wrote: Name and ID serve two different purposes. ID is used to identify the element's node in the document [1]. Name is used to identify the element's value in the form submission posted back to the server [2]. OTOH, according to the HTML 4.01 Strict DTD, name is #IMPLIED, not #REQUIRED, so the book is incorrect. [3] The book is correct. It's a question of HTML having rules that DTD can't represent. In this case, that input elements can be form controls or form functionality (i.e. type attribute has a value of submit or reset). The name attribute is required on form controls but not on form functionality. The DTD format doesn't allow this type of granularity however. A DTD is perfectly capable of specifying that an attribute is required: it uses the syntax #REQUIRED. The spec for the name attribute of the input element states that it is #IMPLIED, not #REQUIRED, therefore it is not correct to say that the name is required. The name is _necessary_ for a control to be a successful control, but the book is still wrong if it states that the attribute is _required_ by the spec. Regards, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] input name and id
On 19/04/07, Nick Fitzsimons [EMAIL PROTECTED] wrote: A DTD is perfectly capable of specifying that an attribute is required: it uses the syntax #REQUIRED. The spec for the name attribute of the input element states that it is #IMPLIED, not #REQUIRED, therefore it is not correct to say that the name is required. Yes, that is true. However, a DTD is not capable of stating that the attribute is optional ONLY when the value of the type attribute is reset or submit. The attribute is required if that is not the case. The name is _necessary_ for a control to be a successful control, but the book is still wrong if it states that the attribute is _required_ by the spec. You're right on one point. If the book states that it's required for ALL input elements, then the book is wrong. However, saying it is optional is equally wrong, because it isn't optional for form control input elements (i.e. all type attribute values other than reset and submit, including the value button, entirely independent of whether the form control may be successful or not). -- David liorean Andersson *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] input name and id
[EMAIL PROTECTED]: Can I just substitute ID for NAME and still adhere to web standards or is NAME really required? 'name' **is** required on inputs. It's confusing, but the name attribute is required on **form controls** (input etc) so that your from can be processed on your server - it's not the same thing as 'name' used elsewhere (e.g. anchors). kind regards Terrence Wood. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] input name and id
Terrence Wood wrote: [EMAIL PROTECTED]: Can I just substitute ID for NAME and still adhere to web standards or is NAME really required? 'name' **is** required on inputs. It's confusing, but the name attribute is required on **form controls** (input etc) so that your from can be processed on your server - it's not the same thing as 'name' used elsewhere (e.g. anchors). 'name' is not required by specification (at least as far as I understand specification) - it's a bit striking to me as what's the use of input element without assigned name?? The only use I can imagine is when script language used on client side will read and process its values. Mariusz Nowak *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] input name and id
[EMAIL PROTECTED] wrote: The HTML XHTML definitive guide from O'Reilly states that NAME is a required attribute in INPUT. Can I just substitute ID for NAME and still adhere to web standards or is NAME really required? I'm coding for HTML 4.01 strict. The name determines the control name for the purposes of submitting the form to the server. An id can't take the place of name for this as it makes having multiple elements with the same name[1] impossible. An id should be added for the purposes of anything client side - including assigning labels to controls using the for attribute (since support for that method is stronger then nesting the input inside the label element). [1] This is often convenient, and in the case of radio buttons - essential. -- David Dorward http://dorward.me.uk/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***
Re: [WSG] input name and id
The name attribute is used to post the element's value to a new page, where as id is used to identify the element within the document. You want both regardless of the duplicate entry when creating the input elements. If you had to leave one out, you would remove the id attribute, leaving only name. *Joseph R. B. Taylor* Sites by Joe, LLC /Custom Web Design Development/ Phone: (609) 335-3076 www.sitesbyjoe.com http://www.sitesbyjoe.com [EMAIL PROTECTED] wrote: The HTML XHTML definitive guide from O'Reilly states that NAME is a required attribute in INPUT. Can I just substitute ID for NAME and still adhere to web standards or is NAME really required? I'm coding for HTML 4.01 strict. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***begin:vcard fn:Joseph R. B. Taylor n:Taylor;Joseph org:Sites by Joe, LLC adr:;;408 Route 47 South;Cape May Court House;NJ;08210;USA email;internet:[EMAIL PROTECTED] tel;work:609-335-3076 tel;cell:609-335-3076 url:http://www.sitesbyjoe.com version:2.1 end:vcard
Re: [WSG] input name and id
On 16 Apr 2007, at 20:17:15, [EMAIL PROTECTED] wrote: The HTML XHTML definitive guide from O'Reilly states that NAME is a required attribute in INPUT. Can I just substitute ID for NAME and still adhere to web standards or is NAME really required? I'm coding for HTML 4.01 strict. Name and ID serve two different purposes. ID is used to identify the element's node in the document [1]. Name is used to identify the element's value in the form submission posted back to the server [2]. OTOH, according to the HTML 4.01 Strict DTD, name is #IMPLIED, not #REQUIRED, so the book is incorrect. [3] [1] http://www.w3.org/TR/html4/struct/global.html#adef-id [2] http://www.w3.org/TR/html4/interact/forms.html#control-name [3] http://www.w3.org/TR/html4/interact/forms.html#edef-INPUT Regards, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] ***