# Insert image to registration form

**URL:** <https://talk.getindico.io/t/insert-image-to-registration-form/898>\
**Category:** General Discussion\
**Created:** [January 15, 2019, 8:10pm UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898 "2019-01-15T20:10:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dattila](https://talk.getindico.io/user_avatar/talk.getindico.io/dattila/32/141_2.png) [@dattila](https://talk.getindico.io/u/dattila)\
**Post date:** [January 15, 2019, 8:10pm UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/1 "2019-01-15T20:10:52Z")

</div>

Dear Indico Team,

How can we insert image to a registration form description? We tried with HTML code and Markdown, but it didn’t work.

Thank you,  
Attila

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [January 15, 2019, 8:13pm UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/2 "2019-01-15T20:13:26Z")

</div>

unfortunately that’s currently not possible - once we find some time to get rid of the legacy angular stuff in the registration form we’ll support some formatting there.

not sure about images though - we had mostly inline things in mind (bold, italic, links, …).

any details on your usecase where you’d need images?

---

<div class="post-metadata">

**Author:** ![dattila](https://talk.getindico.io/user_avatar/talk.getindico.io/dattila/32/141_2.png) [@dattila](https://talk.getindico.io/u/dattila)\
**Post date:** [January 15, 2019, 8:23pm UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/3 "2019-01-15T20:23:30Z")

</div>

Dear ThiefMaster,

Thank you for your fast reply.

> [@ThiefMaster](#):
>
> any details on your usecase where you’d need images?

It’s just a small png in the description, I think it’s in a minimum level question. We try to solve it on another way.

Thank you!

Attila

---

<div class="post-metadata">

**Author:** ![knusperman](https://talk.getindico.io/user_avatar/talk.getindico.io/knusperman/32/149_2.png) [@knusperman](https://talk.getindico.io/u/knusperman)\
**Post date:** [March 6, 2019, 5:00pm UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/4 "2019-03-06T17:00:36Z")

</div>

Hey guys,

I’m running to the problem that I need to have an URL in the registration form. I know that this is not on the agenda right now, but what would be your advice to “hack” this into a regform?

I thought about a free text field and some custom JS that adds a click event listener… but then I’m only able to get the whole content, as I won’t be able to define tags inside the free text, right?

Cheers.

---

<div class="post-metadata">

**Author:** ![kolodzie](https://talk.getindico.io/user_avatar/talk.getindico.io/kolodzie/32/18_2.png) [@kolodzie](https://talk.getindico.io/u/kolodzie)\
**Post date:** [March 7, 2019, 10:07am UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/5 "2019-03-07T10:07:14Z")

</div>

Hm, what about adding a custom `URL` field to the list of available fields? It might require more work but would be less “hacky” than what you are trying to do.

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [March 7, 2019, 10:11am UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/6 "2019-03-07T10:11:19Z")

</div>

Sounds like something that might turn out problematic during a future update. Also, adding new fields with all the Angular mess isn’t trivial at all - so if you can inject JS via customization and do it based on custom content in a freetext field this sounds actually cleaner (even if it’s very hacky).  
The hardest part is probably getting the JS to deal with the angular-generated markup since it’s not present at initial page load.

However, maybe a plugin to inject the JS would work as well and be less of a hack than using customization for it. You can check the `cern_access` plugin in `indico/indico-plugins-cern` on GitHub for an example of using a plugin to inject content to a registration form.

---

<div class="post-metadata">

**Author:** ![knusperman](https://talk.getindico.io/user_avatar/talk.getindico.io/knusperman/32/149_2.png) [@knusperman](https://talk.getindico.io/u/knusperman)\
**Post date:** [March 8, 2019, 1:02pm UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/7 "2019-03-08T13:02:35Z")

</div>

Hey,

thanks for the help.

However, I followed the custom JS approach. For all others that might want to do something similar as a one time thing, here’s the hack (check out the field’s data-id by the inspector):

```
$(document).ready(function () {

 if (~$(location).attr('href').indexOf("event/65/registrations/74/") || ~$(location).attr('href').indexOf("event/65/manage/registration/74/")) {

    function addlink(selector) {
        var x = $(selector);
        if (x.length & x.parent().is("td")) {
            $(document).off("DOMSubtreeModified");
            x.wrap("<a target='_blank' href='https://www.google.com'></a>");
        }
    }
}
$(document).on('DOMSubtreeModified', function () {
    addlink("div[data-id='field-2097-2136']");
});
});
```

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [March 8, 2019, 1:26pm UTC](https://talk.getindico.io/t/insert-image-to-registration-form/898/8 "2019-03-08T13:26:29Z")

</div>

nice hack 😉

just one tip: there’s no point in doing `$(location)` - this is a plain JS object so you can just do `location.href`.
