我有以下腳本構建像這樣一種形式:的Javascript「動態」的形式串聯串到形式的行動
var sHTML = "";
sHTML += "<form id='formScore' method='post' action='q_process3.aspx’>";
sHTML += " ";
sHTML += "<input type='hidden' id='Title' name='Title' value= " + title + ">";
sHTML += "<input type='hidden' id='Result' name='Result' value= " + resultstatus + ">";
sHTML += "<input type='hidden' id='ScorePctg' name='ScorePctg' value= " + scorepctg + ">";
sHTML += "<input type='hidden' id='ScorePoints' name='ScorePoints' value= " + scorepoints + ">";
sHTML += "<input type='hidden' id='PassingPctg' name='PassingPctg' value= " + passingpctg + ">";
sHTML += "<input type='hidden' id='PassingPoints' name='PassingPoints' value= " + passingpoints + ">";
sHTML += "<br><input type='submit'><br>";
sHTML += "<form>";
document.getElementById("divEmail").innerHTML = sHTML;
document.getElementById("formScore").submit();
然而,當此提出,動作/ URL它指向的是:
q_process3.aspx '%3E%20%3Cinput%20type =
因此,它看起來像是立即連接第一個輸入標籤到字符串中表單元素的action屬性。我究竟做錯了什麼?或俯瞰?我知道這很簡單。
您的行爲URL後面有一個明智的報價。這是來自你的代碼還是隻是一個複製粘貼問題?當你將它改爲常規的tick報價'''時會發生什麼? – 2013-04-09 16:18:47
您沒有正確關閉''標記。 – fernandosavio 2013-04-09 16:30:06