# HTML form post using Visualizer

**URL:** <https://community.postman.com/t/html-form-post-using-visualizer/41174>\
**Category:** Help Hub\
**Tags:** visualizer\
**Created:** [November 16, 2022, 6:08pm UTC](https://community.postman.com/t/html-form-post-using-visualizer/41174 "2022-11-16T18:08:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orbital-module-oper6](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/orbital-module-oper6/32/13936_2.png) [@orbital-module-oper6](https://community.postman.com/u/orbital-module-oper6)\
**Post date:** [November 16, 2022, 6:08pm UTC](https://community.postman.com/t/html-form-post-using-visualizer/41174/1 "2022-11-16T18:08:56Z")

</div>

Hi folks,

I am making a request that returns HTML in which a form is built using JavaScript and submitted on page load, for example:

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Identifying...</title>
</head>
<body>
<script>
    var tdsMethodNotificationValue = 'eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjRiMjZiZjMyLTk4YmEtNGM4Yi1hN2ZlLWFhNDRlMjg5YmViMiJ9';

    var form = document.createElement("form");
    form.setAttribute("method", "post");
    form.setAttribute("action", "https://example.com");

    addParameter(form, "threeDSMethodData", tdsMethodNotificationValue);

    document.body.appendChild(form);
    form.submit();

    function addParameter(form, key, value) {
        var hiddenField = document.createElement("input");
        hiddenField.setAttribute("type", "hidden");
        hiddenField.setAttribute("name", key);
        hiddenField.setAttribute("value", value);
        form.appendChild(hiddenField);
    }
</script>
</body>
</html>

```

I’ve set up a visualizer in a test like so:

```auto
const html = pm.response.text();

// set that template to pm.visualizer
pm.visualizer.set(html);

```

However, when I click the Visualize tab, the form is not posted. I can see it is rendered by opening the inspector but I wondered if there are any restrictions on what can be rendered/executed? For example, I tried a simple `alert` within a template and this also failed to run.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 12, 2024, 12:52pm UTC](https://community.postman.com/t/html-form-post-using-visualizer/41174/2 "2024-12-12T12:52:19Z")

</div>

Closed on December 12, 2024, 12:52pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
