# Adding a form to a plugin

**URL:** https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203
**Category:** Development
**Created:** [January 18, 2022, 10:10am UTC](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203 "2022-01-18T10:10:09Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [January 19, 2022, 10:49pm UTC](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203/3 "2022-01-19T22:49:08Z")

</div>

The connector template and JS file need to be in the same directory and have the same name. So

`/assets/javascripts/discourse/connectors/topic-navigation/loner-watch-topic-form.hbs`

```xml
<form {{ action 'lonerWatch' content on='submit' }}>    
    <p>Enter your email address to watch this topic for updates</p>
    <input name="email" placeholder="Your email"/>
    <button>Watch</button>
</form>

```

and

`/assets/javascripts/discourse/connectors/topic-navigation/loner-watch-topic-form.js`

```javascript
export default {
  actions: {
    lonerWatch(content) {
      console.log(content);
    },
  },
};

```

Your action should then work. You can read a bit more [here](https://meta.discourse.org/t/important-changes-to-plugin-outlets-for-ember-2-10/54136) if you’re interested.

---

_[View the full topic](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203)._
