-1
嗨,我正在通過使用JQuery建設web應用程序的asp。驗證超過10
我股票的驗證,例如
myfirstnumber
<input type="number" value="F" class="1" id="myfirstnumber"/>
mysecondnumber
<input type="number" value="S" class="1" id="mysecondnumber"/>
mypercenttextbox
<input type="percentage" value="P" class="1" id="mypercenttextbox ">
我需要做驗證,如果在mypercenttextbox
比10
更大。
我使用jquery此解決方案
function ValidatePayAdjustmentFormFields(){
var isValid = true;
var FirstNumVal = $("[id$="+ ctrlFirstNumVal).val();
var SecondNumVal = $("[id$="+ ctrlSecondNumVal).val();
var percentVal= (SecondNumVal - FirstNumVal) * (100/SecondNumVal);
if ($.trim(percentVal) >= 10)
{
//calling handleError from other function
handleError("mysecondnumber" ,"your mysecondnumber is more than 10% of myfirstnumber ")
isValid = false;
}
}
return isValid;
}
錯誤:未捕獲的語法錯誤:非法return語句 任何形式的幫助和提示將appricated。謝謝