Thursday, July 25, 2019

Reset Button or Clear Values button widget to clear catalog item variable values

Step 1: Create a widget as shown below

Body HTML Template:


<button type="button" class="btn btn-danger btn-block" ng-click="c.setFieldValue(inputValue)">Reset Values</button>


Client Controller script


function($scope) {
var c = this;
c.setFieldValue = function(uploadname) {
var g_form = $scope.page.g_form;
g_form.clearValue("acrobat");
g_form.setValue("Additional_software_requirements", "");
g_form.setValue("test","");
g_form.setValue("photoshop", "");
};
}


Step-2: Create a variable of type Macro and in the default section give this widget name.