javascript校驗實例
function storeCaret(textEl) {if (textEl.createTextRange) { textEl.caretPos = document.selection.createRange().duplicate(); } } function submitSearch() { var key; key = window.event.keyCode; if (key == 13) { doneExpAdv(frmAdvance); } } functiononInsertRelation(text) { var strWhrToInsert; strWhrToInsert = ""; if (strWhrToInsert == 0) { onInsertAdvSql(text); } else { if (strWhrToInsert == 1) { onInsertAdvFormula(text); } else { onInsertAdvSimilary(text); } } } functiononInsertAdvSql(text) { if (document.frmAdvance.txeaExp.createTextRange && document.frmAdvance.txeaExp.caretPos) { var caretPos = document.frmAdvance.txeaExp.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == " " ? text.value + " " : text.value; } else { if (document.frmAdvance.txeaExp.value.length > 0) { document.frmAdvance.txeaExp.value = document.frmAdvance.txeaExp.value + text.value; } else { document.frmAdvance.txeaExp.value = text.value; } } } functiononInsertNumRelation(text) { var msg_str = "請您輸入!"; var input_num; input_num = prompt(msg_str, "2"); if (input_num == null) { return false; } else { if (input_num >= 1 && input_num < 10) { str = "(" + input_num + text.value; } else { alert("你的輸入超出了有效範圍!"); return false; } } if (document.frmAdvance.txeaExp.createTextRange && document.frmAdvance.txeaExp.caretPos) { var caretPos = document.frmAdvance.txeaExp.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == " " ? str + " " : str; } else { if (document.frmAdvance.txeaExp.value.length > 0) { document.frmAdvance.txeaExp.value = document.frmAdvance.txeaExp.value + str; } else { document.frmAdvance.txeaExp.value = str; } } } |
javascript校驗實例
日誌 > 技術交流
評論列表
溫馨提示:點擊驗證碼輸入框,以獲取驗證碼
請輸入驗證碼:
loading......
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.