473,542 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form <inpu> name & id required?

I notice that Dreamweaver automatically adds both name and id
attributes to form input tags. Are both of these required? Is there
some recommendation both should be used?

Caversham

Jul 24 '05 #1
4 1779
Caversham wrote:
I notice that Dreamweaver automatically adds both name and id
attributes to form input tags. Are both of these required? Is there
some recommendation both should be used?


The name attribute is used when submitting the name=value pairs. The id
attribute is useful for referencing from other places, such as with the
for attribute in the label element, with scripts by using
getElementById(), with stylesheets using the ID selector, etc. Neither
of them are required.
--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 24 '05 #2
Caversham wrote:
I notice that Dreamweaver automatically adds both name and id
attributes to form input tags. Are both of these required? Is there
some recommendation both should be used?

Caversham

name is for backward compatibility with legacy browsers, like NN4x.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jul 24 '05 #3
On Sat, 25 Jun 2005 03:18:02 +0200, Jonathan N. Little
<lw*****@centralva.net> wrote:
Caversham wrote:
I notice that Dreamweaver automatically adds both name and id
attributes to form input tags. Are both of these required? Is there
some recommendation both should be used?
Caversham

name is for backward compatibility with legacy browsers, like NN4x.

Not for form elements. Try
<form ...>
<input type="text" id="foo" value="bar"> <input type="submit">
</form>
and see if it works :)
ID and name have different semantics and uses, like Lachlan explained.
Jul 24 '05 #4
Mitja wrote:
On Sat, 25 Jun 2005 03:18:02 +0200, Jonathan N. Little
<lw*****@centralva.net> wrote:
Caversham wrote:
I notice that Dreamweaver automatically adds both name and id
attributes to form input tags. Are both of these required? Is there
some recommendation both should be used?
Caversham

name is for backward compatibility with legacy browsers, like NN4x.

Not for form elements. Try
<form ...>
<input type="text" id="foo" value="bar"> <input type="submit">
</form>
and see if it works :)
ID and name have different semantics and uses, like Lachlan explained.


Input & name:
<URL:http://www.w3.org/TR/html4/interact/forms.html#adef-name-INPUT>
<URL:http://www.w3.org/TR/html4/interact/forms.html#control-name>

ID:
<URL:http://www.w3.org/TR/html4/struct/global.html#adef-id>

HTML attributes:
<URL:http://www.w3.org/TR/html4/index/attributes.html>

--
Rob
Jul 24 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1890
by: Sarah Akers | last post by:
GgF ----gL5cJ72EqiGIQ0SK65Rz Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <head> <style type=3D"text/css">.eyebrow { FONT-WEIGHT: bold; FONT-SIZE: 10px; TE=
0
1132
by: Diane Blevins | last post by:
sFt ----HUISORc8AeipkQw2ckY Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <head> <style type=3D"text/css">.eyebrow { FONT-WEIGHT: bold; FONT-SIZE: 10px; TE=
0
946
by: flashdofu | last post by:
I need to format this field into xxx.xxx.xxx-xx It's automatically generated by the form.php page this is the code... function createInputFieldCPF($field_title,$input_type,$input_name,$input_value,$inpu­t_size,$td_width) { //pre: all parameters are strings. //post: creates in inputField based on parameters.
2
1254
by: balakred | last post by:
<html> <script language="text/javascript"> var test=DValue; </script> <body> <inpu type="text" name="name" value="<script>test</script>" /> </body> </html> i want get the test "DValue" in dynamic.
0
7567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7665
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3377
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1790
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.