87,901
社区成员
发帖
与我相关
我的任务
分享
function testEnterToTab(event,flg) {
var e = event?event:window.event;
if(e.keyCode == 13){
if ('s' == flg) {
doSearchS_Barcode();//提交相关函数
} else if ('b' == flg) {
doSearchB_Barcode();//提交页面相关函数
}
}
}
<html:text name="CollectionLendForm" styleId="s_barcode" property="s_barcode" size="18" maxlength="32" style="width:200px;" onkeydown="testEnterToTab(event, 's');" tabindex="1"/>
function tospeakSound() {
var sLen = <%= sLen %>;
var sbarcode = document.forms[0].s_barcode;
if (sbarcode.value.Trim().length == sLen) {
document.getElementsByTagName("bgsound")[0].src = '<%= ctxtPath %>/images/music/ding.wav';
}
}
<html:text name="CollectionLendForm" styleId="s_barcode" property="s_barcode" size="18" maxlength="32" style="width:200px;" onkeydown="testEnterToTab(event, 's');" onchange="tospeakSound();" tabindex="1"/>
function tospeakSound() {
var sLen = <%= bLength %>;
var sbarcode = document.forms[0].s_barcode;
if (sbarcode.value.Trim().length == sLen) {
var bgTest = document.createElement("bgsound");
bgTest.src = "<%= ctxtPath %>/images/music/Bar.wav";
document.body.appendChild(bgTest);
}
}
//query b_barcode
function doSearchB_Barcode(){
var b_barcode = document.CollectionLendForm.b_barcode;
if(!ChkChr('<bean:message key="caption.library.master.booksmaintenace.b_barcode" />',b_barcode.value,0,0,1)){
b_barcode.focus();
return false;
}
if (b_barcode.value.match(/[^0-9]{1}/)) {
alert('<bean:message key="caption.library.master.booksmaintenace.b_barcode.err1"/>');
b_barcode.focus();
return;
}
document.forms[0].actionHidden.value="<bean:message key="caption.library.lend.submit_query_b_barcode"/>";
document.forms[0].submit();
}
//query s_barcode
function doSearchS_Barcode(){
document.forms[0].actionHidden.value="<bean:message key="caption.library.lend.submit_query_s_barcode"/>";
document.forms[0].submit();
}