高级检索javascript校验

来源:互联网 发布:99热最新地址获取域名 编辑:程序博客网 时间:2024/05/08 07:38
日志 > 技术交流
设置置顶 | 编辑 | 删除

高级检索javascript校验

发表于:2008年2月26日 14时36分4秒阅读(3)评论(0)本文链接:http://user.qzone.qq.com/592433424/blog/1204007764
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;
  }
}
}
 
评论列表
请选择道具
<textarea class="content" id="commentEditor" style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; COLOR: gray! important; BORDER-BOTTOM: #ccc 1px solid" onfocus="getUBBeditor(this)" rows="13" cols="50" name="content">点击这里发表评论</textarea>
温馨提示:点击验证码输入框,以获取验证码
请输入验证码:
     
上一篇|下一篇|返回日志列表
 
原创粉丝点击