Snot Posted February 20, 2011 Share Posted February 20, 2011 My Site has 19 html validation errors related to the unique id's on a number of form's. I'm just getting my feet wet with php and mysql so a friend helped me setup the forms. When I got them they were all their own page. I didn't want to have so many pages so I used css and some basic php to put them include all the files on my index.php. So now the validation is failing. Is there anything I should do to fix this or is it just a false error from my layout? Here is a link to the site if you want to see what i've down with the layout. www.wararmada.com/tdb The error page http://validator.w3.org/check?uri=http%3A%2F%2Fwww.wararmada.com%2FTDB%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1&outline=1&group=1&No200=1&verbose=1&user-agent=W3C_Validator%2F1.2 I wasn't sure if having more than one unique id on the "same" page would cause any problems with how the forms work. Thanks for any advice and help you can give me. Quote Link to comment Share on other sites More sharing options...
Snot Posted February 20, 2011 Author Share Posted February 20, 2011 Fixed the link http://validator.w3.org/check?uri=http%3A%2F%2Fwww.wararmada.com%2Ftdb%2F&charset=%28detect+automatically%29&doctype=Inline&group=1&st=1&user-agent=W3C_Validator%2F1.2 Quote Link to comment Share on other sites More sharing options...
haku Posted February 20, 2011 Share Posted February 20, 2011 The errors are because you are using the same IDs multiple times. If you want to get rid of the errors, change the IDs each time you reuse the elements. Quote Link to comment Share on other sites More sharing options...
Snot Posted February 20, 2011 Author Share Posted February 20, 2011 I think the reason they are the same is because I have one form will one day add stuff to a database and another that will search it. I think its because they are using the criteria. Will changing these id's mess any of that up? Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted February 20, 2011 Share Posted February 20, 2011 I think the reason they are the same is because I have one form will one day add stuff to a database and another that will search it. I think its because they are using the criteria. Will changing these id's mess any of that up? an ID is just like a passport, you only have one and it's bound to 1 specific person. So never use an ID twice. use a class if it is to define a general style. Quote Link to comment Share on other sites More sharing options...
haku Posted February 21, 2011 Share Posted February 21, 2011 I think the reason they are the same is because I have one form will one day add stuff to a database and another that will search it. I think its because they are using the criteria. Will changing these id's mess any of that up? It shouldn't - the id attribute isn't used in server-side form processing. Quote Link to comment Share on other sites More sharing options...
Snot Posted February 21, 2011 Author Share Posted February 21, 2011 Nice! Thanks for the help. I'm remaking them with css so i'll make sure i'm not using the same id's this time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.