📄 card.js
字号:
// Function to validate is a string is numericfunction IsNumeric(sText){ var ValidChars = "0123456789."; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber;}function openURL(theLINK){ // get the value of CARD ID cardid = document.theForm.choose_list.value; // get value of CARDNUMBER and concatenate if any of the values is numeric cardnumber = document.theForm.cardnumber.value; if ( (!IsNumeric(cardid)) && (!IsNumeric(cardnumber)) ){ alert('CARD ID or CARDNUMBER must be numeric'); return; } goURL = cardid + "&cardnumber=" +document.theForm.cardnumber.value; addcredit = 0; // get calue of credits addcredit = document.theForm.addcredit.value; if ( (addcredit == 0) || (!IsNumeric(addcredit)) ){ alert ('Please , Fill credit box with a numeric value'); return; } // redirect browser to the grabbed value (hopefully a URL) self.location.href = theLINK + goURL + "&addcredit="+addcredit; }function clear_textbox(){if (document.theForm.cardnumber.value == "enter cardnumber") document.theForm.cardnumber.value = "";} function clear_textbox2(){ if (document.theForm.choose_list.value == "enter ID Card") document.theForm.choose_list.value = "";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -