Set sn-record-picker mandatory

DPrasna
Tera Contributor

Hi All,

I have a custom widget inside which I use a sn-record-picker reference field on a custom form as shown below

HTML

<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label for="firstname"><b>User Name</b></label> 

<sn-record-picker id="firstname" field="c.addUsr.firstname"
table="'sys_user'"
default-query="data.existUserid"
display-field="'name'"
display-fields="'email'"
value-field="'sys_id'"
search-fields="'name,email'"
page-size="100"                 
>
</sn-record-picker>

</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label for="email"><b>Email</b></label>
<input type="text" placeholder="Enter Email" class="form-control" name="email" disabled required ng-model="c.addUsr.email1">
</div>
</div>

</div>

How to set the sn-record-picker field mandatory?

Please help.

TIA

@Ankur Bawiskar @BharathChintala @Allen Andreas @priyasunku @SatyakiBose 

1 ACCEPTED SOLUTION

@DPrasna 

 

can you please try this

 

<span style="padding-right: .25em" title="Mandatory" class="fa fa-asterisk mandatory" ng-class="{'mandatory-filled': data.user.value != ''}"></span>

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful

View solution in original post

5 REPLIES 5

Manthira Moorth
Tera Expert

Hi @DPrasna ,

 

I can see that you have accept the solution. if you don't mine, can you give the working code for the example. How to set the mandatory.

 

It will be very helpful for me. if you give the code snippet.

 

Regards,

Manthira Moorthi R