js :check 檢查

DropDownList是否選定的判定:

if (Form1.DropDownList1.selectedIndex==(parseInt("0"))){ 
 alert("12555");
  return false;}

checkbox是否選定的判定:
if (document.Form1.RadioButton1.checked==false) {
   alert('請選定復判結果!');
  return false;}

js比较文本框数据大小:

  var getqty =parseInt(document.Form1.TextBox11.value);
var failqty =parseInt(document.Form1.TextBox12.value);
var samqty =parseInt(document.Form1.TextBox13.value);
var fineqty =parseInt(document.Form1.TextBox14.value);

if (getqty<(parseInt("0"))){
 alert('批量不得小於0!');
  document.Form1.TextBox11.focus();
  return false;
 }

if (failqty>getqty){
 alert('不良數不得大於批量!');
  document.Form1.TextBox12.focus();
  return false;
 }

if ((fineqty+failqty)>getqty){
 alert('不良數與良品數之和不得大於批量!');
  document.Form1.TextBox12.focus();
  return false;
 }

posted @ 2006-07-13 17:58  Nina  阅读(706)  评论(0)    收藏  举报