Missing asterisk for required fields in review forms

Hi there,

i noticed that required fields of review forms don’t show the asterisk.
This is due a missing required parameter in the smarty section call at:

Adding required=$reviewFormElement->getRequired() certainly helps but it puts the asterisk below the label text because the html is rendered as

<label>
  <p>My label</p>
  <span class="req">*</span>
</label>

and <p> is a block element which comes from TinyMCE when entering the element title in the backend.

This is also not HTML5 compliant as <label> cannot contain <p>.

What about replacing <label> by <div>? Surely we would lose the link between a label (when rendered with for attribute) and the input field in but it would allow valid HTML.

Or how about adding a req class to label to allow adding a style like label.req > p:first-child:after { content: "*"; } to render the asterisk by CSS?

So lonG
Daniel

Hi @j1shin,

Thanks for the suggestions. There is already an open issue for this: Improve "Required" field labels on review forms · Issue #2359 · pkp/pkp-lib · GitHub

Can you please comment there?

Thanks,
Amanda Stevens
Public Knowledge Project Team

Thx for the reply. Done via Improve "Required" field labels on review forms · Issue #2359 · pkp/pkp-lib · GitHub

1 Like