This is a migrated thread and some comments may be shown as answers.

Validation message span not positioning correctly when input is nested in anchor tag

1 Answer 42 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 03 Apr 2013, 10:00 PM
Why doesn't this work? The invalid message span is moved to be a sibling of the input element. Shouldn't it remain outside the anchor tag?

I've created a jsbin here.

Thanks,
Jon

1 Answer, 1 is accepted

Sort by
0
Jon
Top achievements
Rank 1
answered on 03 Apr 2013, 10:06 PM
Just found it. Apparently, the data-for attribute should be set to the input element's name not the id.

It even says so here.
Tags
Validation
Asked by
Jon
Top achievements
Rank 1
Answers by
Jon
Top achievements
Rank 1
Share this question
or