View Full Version : Strange problem with validation
10-24-2006, 10:02 PM
Does anyone know another way to validate a form instead of using ID or name?
I understand that there is something called validation by element but im not sure i understand what that is.
Thank you for reading through.
10-24-2006, 10:22 PM
Are you asking how to select a form element without using an ID? You could do it based on the elementís position in the page structure; for example, document.getElementsByTagName("input") would select the fifth occurance of an input element in the document.
10-24-2006, 10:56 PM
so say i have 3 input boxes and then 2 drop down objects would that be then be document.getElementsByTagName("input") or would just the input boxes be in the array??
Im sorry i cant seem to get out what i mean clearly.
but thanks for the help.
10-25-2006, 12:37 AM
getElementsByTagName() is an array of all elements in the document matching the provided name; the elements are in the array in the order in which they appear the document. getElementsbyTagName("input") would not include drop-down objects; you would need getElementsByTagName("select") for that.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.