Prevent Form Submission via widget

abjaffrey
Giga Guru

Hi 

 

Im using MRVS in a catalog item, however its hidden in the portal as radio buttons is needed instead of editing the row . i have written a widget script for fetching the data. There is a notes field which should be visible when we select no and it should be mandatory. im unable to achieve this rest all is fine

 

If no button is selected notes is visible and the border is also red but if its empty its not preventing the submission

 

The html code for notes

 

<th class="notes-cell" colspan="7">
<div class="slide" id="{{item.asset}}">
<input type="text" required ng-model="item.notes" class="notes-text" ng-change="c.saveNots()" placeholder="{{data.placeholder}}">
</div>
</th>

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@abjaffrey 

so if no is selected in variable within MRVS then outside variable should be red?

Is notes an outside variable i.e. outside MRVS on catalog form?

please share some details what type of variable is notes? share screenshots.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Basically the whole thing is from widget ihave created a table which fetches the value from asset table 

 

tbody ng-repeat="item in data.assets">
<tr>
<th class="icon-cell">
<div>JA</div>
<input type="radio" name="option{{$index}}" id="yes-{{$index}}" value="Ja" ng-click="c.setAction(item)">
<th>
<div>NEJ</div>
<input type="radio" name="option{{$index}}" id="no-{{$index}}" value="Nej" ng-click="c.setnoAction(item)">

 

once done the values are mapped to MRVS in backend for RITM

the MRVS is not visible in SP