Community > Answers
47 views

Invalid label for field

A correct way to refer to a field via the label is via the for attribute: 
<label for="dnn_ctr986_View_Textbox_986_1">Fill in your name</label><input type="text" id="dnn_ctr986_View_Textbox_986_1">

The way that Live Forms generates this, is (which is not WCAG 2 valid): 
<label for="__Page_Textbox_986_1">Fill in your name</label><input type="text" id="dnn_ctr986_View_Textbox_986_1">

Is there any chance that you will correct this soon and refer to the input with the input id that is used?
Or has anyone ever written some jQuery to replace the for attribue value?

Thank you!

Keston Pollard Keston Pollard
asked 03/04/2021 16:52
Add Comment
Keston Pollard
replied 03/04/2021 17:05

I added some jQuery, but it would be nice if that wasn't necessary.

$('.ModLiveFormsC #Field_986_1 label').attr('for','dnn_ctr986_View_Textbox_986_1');
$('.ModLiveFormsC #Field_986_2 label').attr('for','dnn_ctr986_View_Textbox_986_2');
$('.ModLiveFormsC #Field_986_3 label').attr('for','dnn_ctr986_View_Dropdown_986_3');

Last Activity 03/04/2021 17:05

No answers found

Add an Answer