Skip to content Skip to sidebar Skip to footer

Spaces Converting To '+' From Html Form

So I've been playing around with HTML forms and I am kind of new you all of this so any help would go a long way! But anyway... This is my form coding for emailing. So when I sub

Solution 1:

You should set the enctype attribute of the <form> tag to text.

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

More details in this KB

In both cases, the FORM data is e-mailed in as an Attachment, in an encoded format. For instance, in the preceding case, this is how the data looks:

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 e-mail data in > plain-text format instead, explicitly specify an ENCTYPE attribute of "text/plain". For instance:

<FORMAction="mailto:xyz"METHOD="POST"ENCTYPE="text/plain">
    mailto: protocol test:
    <Br>Subject: 
    <INPUTname="Subject"value="Test Subject"><Br>Body:&#xa0;<TEXTAREAname="Body">
    kfdskfdksfkds
    </TEXTAREA><BR><INPUTtype="submit"value="Submit"></FORM>

produces the following Body:

Subject=Test Subject
Body=   kfdskfdksfkds

Solution 2:

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

Post a Comment for "Spaces Converting To '+' From Html Form"