2014-05-14 105 views
1

我正在用複選框進行測驗,並通過電子郵件發送答案。 但是當得到的答案張貼到電子郵件正文中有沒有換行符,\ n,
,&#10 ....不工作,請指教HTML用換行符提交文本值

<form method=post action=mailto:[email protected]> 
<ol> 
Name:<thisUserName><p> 
<li> 
    How do you spell cat?<br> 
    <input type ='checkbox' name = 'Q1' value ='A'> 
    KAT<br> 
    <input type ='checkbox' name = 'Q1' value ='B'> 
    Kit-Kat<br> 
    <input type ='checkbox' name = 'Q1' value ='C'> 
    Cat<br> 
<li> 
    <IMG SRC=http://upload.wikimedia.org/wikipedia/commons/9/91/Schrodingers_cat.svg height="400" width="400">. <br> 
    According to Schrödinger is the cat alive or dead?<p> 
    <input type ='checkbox' name = 'Q2' value ='A'> 
    Dead<br> 
    <input type ='checkbox' name = 'Q2' value ='B'> 
    Alive<br> 
    <input type ='checkbox' name = 'Q2' value ='C'> 
    Both<br> 
<li> 
    What do you know about cats?<p> 
Answer:<input type=textarea name=Answer3 rows="5" cols="20" wrap="physical" ><br> 
<center><input type='submit' value='Submit answers by e-mail' onClick='alert("Quiz answers are being sent by e-mail.")'></center></ol> 
</form> 

電子郵件身體看起來像Q1=A&Q2=A&Answer3=meow ,我希望它看起來像

Q1=A 
Q2=A 
Answer3=meow 
+1

這應該PH完成P,而不是HTML。 –

+0

也許嘗試:'\ r \ n' – martijnn2008

+0

@ user3636021注意:下次發佈問題時,請從中刪除私人數據。 – Faraz

回答

0

這個解決方案工作

<form method="post" enctype="text/plain" action="mailto:[email protected]?subject=my%20test%20form"> 
<ol> 
Name:<thisUserName><p> 
<li> 
    How do you spell cat?<br> 
    <input type ='checkbox' name = 'Q1' value ='A'> 
    KAT<br> 
    <input type ='checkbox' name = 'Q1' value ='B'> 
    Kit-Kat<br> 
    <input type ='checkbox' name = 'Q1' value ='C'> 
    Cat<br> 
<li> 
    <IMG SRC=http://upload.wikimedia.org/wikipedia/commons/9/91/Schrodingers_cat.svg height="400" width="400">. <br> 
    According to Schrödinger is the cat alive or dead?<p> 
    <input type ='checkbox' name = 'Q2' value ='A'> 
    Dead<br> 
    <input type ='checkbox' name = 'Q2' value ='B'> 
    Alive<br> 
    <input type ='checkbox' name = 'Q2' value ='C'> 
    Both<br> 
<li> 
    What do you know about cats?<p> 
Answer:<input type=textarea name=Answer3 rows="5" cols="20" wrap="physical" ><br> 
<center><input type='submit' value='Submit answers by e-mail' onClick='alert("Quiz answers are being sent by e-mail.")'></center></ol> 
</form> 
+0

謝謝你,這對我也是如此:) – user3636021