0
我通常編程java,但開始編程javascript和我搜索和搜索,但找不到任何工作。我的問題是,有4個輸入字段(PARID,Groups,Customer和Projectname),我想將它們的值加在一起做成一個大字符串,例如:123456_NEC_Franzi_Seestadt,但每次我試圖獲得警報時,它只是讓我說「未定義」Javascript(with Sharepoint 2007)alert
<p>
Par ID:
<input id = "PARID">
</p>
<p>
Research Group:
<select id = "Groups">
<option></option>
<option>BAM</option>
<option>PAS</option>
<option>AVT</option>
<option>SRA</option>
<option>NEC</option>
<option>ITP</option>
<option>ELD</option>
<option>RFT</option>
<option>SEE</option>
</select>
</p>
<p>
Customer:
<input id = "Customer">
</p>
<p>
Projectname:
<input id = "Projectname">
</p>
<p>
Submit:
<input id = "Submit" type = "button" value = "Submit" onclick = "output()">
</p>
<script>
function output() {
var w, text;
// alert ("did it work?");
document.getElementById("PARID").value = w;
if (w != null) {
alert(w);
}
}
</script>
您必須編寫'w = document.getElementById(「PARID」).value;'而不是! – cFreed