Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

How to inject variables in the html of widgets #741

Open

Description

@jamesonwildwood

I have a widget that is a form, and I'd like to be able to inject into the html where the form is posting to. I've tried a bunch of ways to do this. I'd like to be able to put that variable in the ERB so I can reuse the widget across multiple environments, mostly prod/dev

<form id="rq-submit" action="<%= @esb01 %>" method="post" target="submit_frame">
  Import Year: <select name="runProcess">
    <option value="current">Current</option>
    <option value="next">Next</option>
  </select>
  <script>
  function confirmSubmit() {
    if (confirm("Are you sure you want to run the import?")) {
      document.getElementById("budget-import").submit();
    }
    return false;
  }
  </script>
  <input type="submit" value="Submit" onclick="return confirmSubmit()">
</form>

Is there anyone who has solved this?

Activity

  1. jamesonwildwood commented on Mar 31, 2017

    @jamesonwildwood
    Author

    Or is there a way to add a coffeescript thing to be the submit logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions