내가자바 스크립트 ") (제출;"기능 오류를 찾을 수 없습니다
<form name="selectdoctype" method="post" action="" id="selectdoctype">
<table style="border:none;">
<tr><td colspan="2"> (<span class="asterisk" style="color:#FF0000;">*</span>) Mandatory</td></tr>
<tr>
<td style="border-right:none">Document Name:</td>
<td style="border-right:none">
<input type="text" name="doc_name" value="" /><span class="asterisk" style="color:#FF0000;">*</span>
</td>
</tr>
<tr>
<td style="border-right:none">Document type:</td>
<td style="border-right:none">
<select name="doctype_id" onchange="doPaymentfor(this.value);"><option value="-1" >--Select Document Type--</option>
<?php
foreach($arr_createdoc as $doctype){
?>
<option value="<?php echo $doctype['doctype_id'];?>"><?php echo $doctype['doctype_name'];?></option>
<?php }?>
</select>
</td>
</tr>
<tr>
<td style="border-right:none" id="purchaselabel"></td>
<td style="border-right:none">
<select name="purchasedoc_id" id="purshasedocs" style="display:none;"><option value="-1" >--Select Document Type--</option>
<?php
foreach($arr_purchasedoc as $docpurchase){
?>
<option value="<?php echo $docpurchase['doc_id'];?>"><?php echo $docpurchase['doc_name'];?></option>
<?php }?>
</select>
</td>
</tr>
<tr>
<td style="border-right:none">Document Distribution:</td>
<td style="border-right:none">
<select name="distribution_id">
<option value="-1">---Select Distriution---</option>
<?php foreach($arr_distribution as $distribution){?>
<option value="<?php echo $distribution['distribution_id'];?>"><?php echo $distribution['distribution_name'];?></option>
<?php }?>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center" style="border-right:none">
<input type="button" name="submit" value="Proceed" class="submit" onclick="valdocAddEdit(this.form);"/>
</td>
</tr>
</table>
</form>
및
function valdocAddEdit(frm) {
if ((frm.doc_name.value == null) || (frm.doc_name.value == "")) {
alert("Please enter Document Name!")
frm.doc_name.focus()
return false;
}
if(frm.doc_name.value.length > 50) {
alert("Document Name can not be more than 20 characters!");
frm.doc_name.focus();
return false;
}
if(frm.doctype_id.value == "-1") {
alert("Please Select Document Type Name!");
frm.doctype_id.focus();
return false;
}
if(frm.doctype_id.value == "1") {
if(document.getElementById('purshasedocs').style.display == "block"){
if(frm.purchasedoc_id.value == "-1"){
alert("Please Select Purchase Order Name!");
frm.purchasedoc_id.focus();
return false;
}
}
}
if(frm.distribution_id.value == "-1") {
alert("Please Select Distribution Name!");
frm.distribution_id.focus();
return false;
}
frm.submit();
}
로 자바 스크립트 함수로 양식을 가지고 있지만 모든 자바 스크립트 유효성이 확인 될 때마다 양식으로 제출받을 doesnot "frm.submit is a function"이 아닌 javacript 오류가 발생합니다. in firebug.
코드가 잘못되어있는 곳을 알려주시겠습니까?
-1 적절한 문장을 사용하십시오. – Tomas
나는 매우 유감 스럽다. 그러나 나는 중국어 다, 나의 영어는 매우 가난하다! – island205