Submit catalog if acknowledgement is checked in modal window / cancel button to go back

Lakshmi Prasann
Giga Expert

Hi All,

I have a catalog form, in that when the user tries to submit the form, it should display a modal window with an acknowledgement text and a check box. The user has to check the check box to accept the acknowledgement to submit the form. And, if the user clicks on Cancel button it should take the user to previous page.

 

I tried with an UI page and glide modal with no luck.

 

Can someone help me here?

 

Thanks in Advance!

1 ACCEPTED SOLUTION

Hi @Lakshmi Prasann,

Yes, it is possible. Try changing the HTML to the following.

 

<h3 class="widget-heading">Acknowledgement</h3>
<div>
  <div class="row">
    <div class="col-sm-12 col-md-12">
      Your acknowledgement text here.<br/>
      <div class="col-md-12 pull-right">
        <div class="form-group">
          <br>
        	<label class="col-sm-12 checkbox-inline">
          	<input id="usrAcknowledged" type="checkbox" ng-required="true" ng-model="c.data.ack_val" value="acknowledged"> I Acknowledge </label>
      	</div>
      </div>
    </div>   
  </div>
  <br>
    <div class="modal-footer">
    <button type="submit" ng-click="$c.data.ack_val && parent.$parent.buttonClicked($parent.$parent.options.buttons[1])" class="btn btn-primary pull-right m-l-sm">Submit</button>
    <a href="javascript&colon;window.history.back()" class="btn btn-primary pull-right m-l-sm" role="button">Cancel</a>
  </div>
</div>
Thanks,
Anvesh

View solution in original post

5 REPLIES 5

Hi @imran rasheed 

 

Just change the onLoad client script to this one.

 

function onLoad() {

    g_user.readyForSubmit = false;

    g_user.showAlterServicePortal = function() {

        var shared = {};

        var popupOptions = {

            widget: 'acknowledgement_test',

            shared: shared,

            footerStyle: {

                display: 'none'

            }

        };

        var modalInstance = spModal.open(popupOptions).then(function() {

            g_user.readyForSubmit = true;

        });

    };

   g_user.showAlterServicePortal();

}

 

Please mark my answer helpful if it helped 👍

Thanks,
Anvesh