I'm using HTML5 and I'm getting a validation error Bad value for attribute href on element a: Illegal character in scheme data: space is not allowed. from [https://validator.w3.org/nu/].
The code functions just as expected, but I need to avoid the validation error.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset=utf-8>
<title>My Page Title</title>
</head>
<body>
<h1>My Page Header</h1>
<ul>
<li class="block_left_380_text_18">
Are you receiving our weekly Emails?
Please
<a href="mailto:myemail@hotmail.com&subject=Please add me to the Group
mailing list&body=This request comes from the link on the website's
home page.%0D%0A
My Name Is:%0D%0A
My Street Address is:%0D%0A
My City / State / Zip are:%0D%0A
My Primary Phone is:%0D%0A
My Primary Email (if different from the FROM field above):%0D%0A
Other members of my household:">Click Here</a>
to send an Email to myemail@hotmail.com to be included.
</li>
</ul>
</body>
</html>
I've used MAILTO many times, but this is the first time I've used it with a Body argument. As you can see, the body= element has a lot of spaces in it. If I replace all spaces with %20, the validator complains about the $OD%OA at the end of each line. How can I use the HREF / MAILTO where the body has a lot of spaces and CR/LF's?
The problem was with the tabs and returns that were put in the HTML editor (Dreamweaver CS6) for readability. It seems that when using a MAILTO: there can be no formatting tabs or returns. While I was at it, I escaped all the slashes, colons, etc. The code that passes validation on [https://validator.w3.org/nu/]. looks like this:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset=utf-8>
<title>My Page Title</title>
</head>
<body>
<h1>My Page Header</h1>
<ul>
<li class="block_left_380_text_18">
Are you receiving our weekly Emails?
Please
<a href=
"mailto:myemail@hotmail.com&subject=Please%20add%20me%20to%20the%20mailing%20list&body=This%20request%20comes%20from%20the%20link%20on%20the%20home%20page.%0D%0AMy%20Name%20Is%3A%0D%0AMy%20Street%20Address%20is%3A%0D%0AMy%20City%20%2F%20State%20%2F%20Zip%20are%3A%0D%0AMy%20Primary%20Phone%20is%3A%0D%0AMy%20Primary%20Email%20(if%20different%20from%20the%20FROM%20field%20above)%3A%0D%0AOther%20members%20of%20my%20household%3A">
Click Here
</a>
to send an Email to myemail@hotmail.com to be included.
</li>
</ul>
</body>
</html>