How to add condition for mandatory in HTML widget

chandan15
Tera Contributor

Hi,

We have a checkout page for a portal, where we are getting user address details before checkout, but there is a state field which is mandatory and need to fill manually.

Now I want to add a condition before make the state field mandatory. 

Condition ->getLoginUser(sys_user)->Country->Field(Have states or Province ?--True)

HTML template codes are:-

<div ><i class="fa fa-asterisk mandatary " ng-class="{ 'redmarkIcon' : c.state == '' }"/>State/Province</div>
          <div ng-show="c.country!= 'US'"><input type="text"  ng-model="c.state"class="form-control"autocomplete="nope"/></div>
          <div ng-if="c.country== 'US'" > 
          <select ng-required ng-model="c.selectedCountry" ng-init="c.populatestate(c.state)"  style="width:100%" ng-change="c.populatestate(c.selectedCountry.code)" ng-options="x.name for x in c.countries"class="form-control"></select></div>
        <div style="color:red" ng-if="c.country== 'US' && !c.selectedCountry">Please select state</div>

 I have shared some screenshot to understand the current scenario, and also added the client controller script screenshot, I can share the whole code but it will little lengthy .

 

Please someone give me some idea, how can I add this condition here........

Thank you!!!!!!!!!!!!

0 REPLIES 0