lindm Posted July 30, 2008 Share Posted July 30, 2008 Reading different views on if both the id and name are necessary for a form element. What are your views? See http://bytes.com/forum/thread150126.html http://www.webmasterworld.com/forum21/6195.htm Link to comment https://forums.phpfreaks.com/topic/117351-name-and-id-necessary-in-form-element/ Share on other sites More sharing options...
rhodesa Posted July 30, 2008 Share Posted July 30, 2008 as far as i know, the NAME attribute specifies name of the element passed by the form. i sometimes use ID too if i want to access it with document.getElementById(), but most of the time i don't need that. using just ID doesn't allow for form element arrays (like name="chkbox[]")... Link to comment https://forums.phpfreaks.com/topic/117351-name-and-id-necessary-in-form-element/#findComment-603813 Share on other sites More sharing options...
haku Posted July 31, 2008 Share Posted July 31, 2008 Id isn't necessary, though its often very useful. The name value however is necessary if you want to pass values (which, other than maybe the submit button, passing values is what forms do). Link to comment https://forums.phpfreaks.com/topic/117351-name-and-id-necessary-in-form-element/#findComment-604210 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.