Page 1 of 1

What happens when two elements share the same ID Tag #

PostPosted: Tue Nov 25, 2014 11:55 am
by AmeliaE
Morning:

What happens if two page elements have the SAME ID tag value.

Does eValid fall over in this case?

Re: What happens when two elements share the same ID Tag #

PostPosted: Fri Nov 28, 2014 9:47 am
by eValid
AmeliaE wrote:Morning:

What happens if two page elements have the SAME ID tag value.

Does eValid fall over in this case?


Thanks for asking AmeliaE.

The browser doesn't care. No requirement for unique IDs exists.

In spite of that, it is bad form not to have ID's be unique.

Even so, non-unique IDs' happen a lot, e.g. when two part of the page have been copied from other pages and the assigned ID tags happen to coincide.

But if you search, you have to watch out. Because in eValid the IndexFind command finds the FIRST index including and after (higher) the current one. See the manual page:

http://www.e-valid.com/Products/Documen ... ement.html

If the what you really want to do is search for the second one, the way you do that is to run two searches laid out as follows:

IndexSet 0
IndexFindElement ..."Id"..."Value"
IndexMove +1
IndexFindElement ..."Id"..."Value"

This finds the second ID tag (if it exists) with the specified value.

Here is the manual page for all of the element manipulation commands:

http://www.e-valid.com/Products/Documen ... ement.html

-- eValid Support