Search code examples
javascriptimpromptu

Call another prompt after submit prompt


I want to call another prompt after submitting my answer, but the .prompt inside LoadNewRecord function doesn't show up. Any idea ?

Submit prompt:

$.prompt("Opening Recap with ID " + Recap[0][0].id + ".<br> Note: Any changes on Recap " + header.find("#recap_id").val() + " will not be saved.", {
  title: "WARNING",
  buttons: {
    "Continue": true,
    "Cancel": false
  },
  submit: function(e, v, m, f) {
    var Recap_status;
    if (v === true) {
      Recap_status = Recap[0][0].status;
      LoadNewRecord(Recap, header);
      return $("#error_history").hide();
    } else {
      return selectedRecap();
    }
  }
});

Prompt in LoadNewRecord function:

if (period_lock >= getDateInput(Recap[0][0].recap_date) && Recap_status < 20) {
  setTimeout((function() {
    $.prompt("You are not allowed to make any changes for all documents before " + period_lock + ". Please contact your administrator for further information");
  }), 100);
}

Note: I use setTimeout after reading this question, but still doesn't work..

if I remove the $.prompt inside LoadNewRecode or change it to alert everything works fine.


Solution

  • For those of you who stuck with this issue, all you need to do is to download the latest impromptu here..

    For more details you can refer to this post on Github..