Button Rules

Forums General discussion Button Rules

Viewing 3 reply threads
  • Author
    Posts
    • #32318
      Danielle Arcuri
      Participant

      Hi! I would like to see if it is possible to create a rule based on an HTML button.

      I can create the button in tabs with HTML code but I need coding for when I click the button a new field will display.

      My button will display “Add Comments”
      The field I want to display on click is “Comments”.

      Is that possible?

    • #32320
      Alexander Bautz
      Keymaster

      Hi,
      Create a rule that has the trigger “No trigger (must be called manually)” and then have your button call a function in your Custom JS that calls the function like this:

      spjs.dffs.triggerRule(["IndexOrFriendlyNameOfRule"]);

      Alexander

    • #32326
      Danielle Arcuri
      Participant

      Hi thank you, I think I am missing something.

      I have my HTML button, the custom JS, and the rule set to display a box on manual trigger but it does not work.

    • #32330
      Alexander Bautz
      Keymaster

      Hi,
      Your button must have an onclick pointing to a function in your custom js – like you have it now, the custom js is running when you open the form and not when you click the button.

      Use this button HTML code:

      <input type="button" onclick="showCommentBox();return false;" value="Show commentbox">

      And this Custom JS:

      function showCommentBox(){
          spjs.dffs.triggerRule(["CommentBox"]);
      }

      Alexander

Viewing 3 reply threads
  • You must be logged in to reply to this topic.