Convert spaces to '+' from HTML form

So, I played with HTML forms, and I'm kind of new to this, so any help can go a long way! But in any case ... This is my encoding form for sending by email.

enter image description hereenter image description here

Therefore, when I submit this form with the correct filled fields, it opens in Outlook (2010, if that matters), then it converts the spaces in the body of the letter to "+" (plus characters) ... Can someone give me ideas? This HTML code will be used on an offline site on our network and will not go live. All computers are in the domain and will have access to this HTML link on the desktop.

+4
source share
2 answers

You must set the enctypetag attribute <form>in the text.

<form enctype="text/plain" ...

More in this KB

In both cases, FORM data is sent by e-mail as an attachment in encoded format. For example, in the previous case, the data looks like this:

Subject=Test+Subject&Body=%09kfdskfdksfkds%0D%0A%09

This is because the default ENCTYPE attribute for the FORM element is "application / x-www-form-urlencoded". To send data in text format instead of email, explicitly specify the ENCTYPE attribute for "text / plain". For example:

<FORM Action="mailto:xyz" METHOD="POST" ENCTYPE="text/plain">
    mailto: protocol test:
    <Br>Subject: 
    <INPUT name="Subject" value="Test Subject">
    <Br>Body:&#xa0;
    <TEXTAREA name="Body">
    kfdskfdksfkds
    </TEXTAREA>
    <BR>
    <INPUT type="submit" value="Submit"> 
</FORM>

produces the following body:

Subject=Test Subject
Body=   kfdskfdksfkds
+4
source

You can use %20for spaces in links mailto. I think you need to convert +to spaces before opening the link mailto.

+2

All Articles