Custom Subject Line with Special Characters

I have a custom email subject line being built by a function since we want it dynamic on the company name field.

<div class="input-group" id="input-company-name">
  <label for="company">COMPANY NAME</label>
  <input
    id="company"
    oninput="updateSubject(this.value)"
    aria-label="company name"
    name="company"
    placeholder="Company Name"
    type="tel"
    tabindex="0"
  />
</div>

function updateSubject(valCompany) {
  document.getElementById("output-company-subject").value =
    "forEach <> " + valCompany;
}

But when I receive an email and lets say the company name is Test Company, the subject line comes in as forEach &lt;&gt; Test Company
How can I make it so that we show the character instead of the html entity code?

Hi :wave:t6: ,

Thanks for reaching out and welcome to the forums! Have you tried searching the forums? There are few threads similiar to this one that have a few solutions that might work for your use case.

Yes, I am able to get the custom subject updated but my problem is with the special characters.
When I expect my Subject to be “forEach <> Test Company”, the actual email comes with the subject “forEach <> Test Company”. So just wondering how I can update it so that the subject can handle special characters. The issue is with the “<” and “>” characters.

hmm make sense! To display the actual characters instead of HTML entity codes in your email subject line, you can use the JavaScript innerHTML property instead of value when updating the subject.

type attribute of the <input> element from "tel" to "text" since it seems more appropriate for a company name input field.

Specifically use the innerHTML instead of value

Can you give it a go and see if that helps?