I have to add asterisk symbol(*) on required field how can I do this in polymer .
<paper-input id="firstNameText" required label="First Name" ></paper-input>
How to add asterisk symbol in required Field
239 Views Asked by Satyam Kumar At
3
There are 3 best solutions below
0
On
The paper-input has both a prefix and a suffix slot, so you can add a span or even another Polymer element into the slot.
<paper-input id="firstNameText" label="First Name">
<span class="colourRed" slot="prefix">*</span>
</paper-input>
<paper-input id="surnameText" label="Surname">
<required-element slot="suffix"></required-element>
</paper-input>
If you want to use the required attribute, you would do something along the lines of the following:
<paper-input auto-validate
char-counter
class="fillWidth100Percent"
error-message="Please enter a name."
invalid="{{invalid.FirstName}}"
label="First Name"
maxlength="255"
required
value="{{firstName}}">
<required-element slot="suffix">
</required-element>
</paper-input>
Note that the required-element would be a custom element.
Check paper-input
You have there some information about it
Note that you would have to use paper-input-container also
Might this work?: