1.I don’t know which forum I should open this topic but… I have problem when I loading the data to init the dhtmlx components. it stops everytime in different place. so I can’t tell where is real problem. if I click the tab, I noticed that sometimes it will not load the data to combo. the problem disappear if I refresh the page several times by press the shift key and click refresh button.
2.And another thing bothered me is if I put div contractManagement in front of classManagement, then classManagement tab disappears.
3.And for the form item I am trying to load, it will have different behaviar if I have end the tag <item…/> and <item…>.
here is my html code:
<link rel="stylesheet" type="text/css" href="dhtmlxComponents/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="dhtmlxComponents/dhtmlxtabbar.css">
<link rel="stylesheet" type="text/css" href="dhtmlxComponents/skins/dhtmlxform_dhx_skyblue.css">
<link rel="stylesheet" type="text/css" href="dhtmlxComponents/dhtmlxcombo.css">
<link rel="stylesheet" type="text/css" href="dhtmlxComponents/dhtmlxcalendar.css">
<link rel="stylesheet" type="text/css" href="dhtmlxComponents/skins/dhtmlxcalendar_dhx_skyblue.css">
<script type="text/javascript" src="dhtmlxComponents/dhtmlxcommon.js"></script>
<script type="text/javascript" src="dhtmlxComponents/dhtmlxgrid.js"></script>
<script type="text/javascript" src="dhtmlxComponents/dhtmlxgridcell.js"></script>
<script type="text/javascript" src="dhtmlxComponents/dhtmlxtabbar.js"></script>
<script type="text/javascript" src="dhtmlxComponents/dhtmlxtabbar_start.js"></script>
<script type="text/javascript" src="dhtmlxComponents/dhtmlxform.js"></script>
<script type="text/javascript" src="dhtmlxComponents/ext/dhtmlxform_item_combo.js"></script>
<script type="text/javascript" src="dhtmlxComponents/dhtmlxcombo.js"></script>
<script type="text/javascript" src="dhtmlxComponents/dhtmlxcalendar.js"></script>
<script type="text/javascript" src="dhtmlxComponents/ext/dhtmlxform_item_calendar.js"></script>
<script type="text/javascript" src="dhtmlxComponents/excells/dhtmlxgrid_excell_dhxcalendar.js"></script>
<script>
window.dhx_globalImgPath = "dhtmlxComponents/imgs/";
var myCustomerGrid = null;
var myCustomerQueryForm = null;
var myCustomerForm = null;
var myBabyGrid = null;
var myBabyGridButtonsForm = null;
var myBabyForm = null;
var myCustomerContractGrid = null;
var myCustomerContractGridButtonsForm = null;
var myCustomerContractForm = null;
var myContractGrid = null;
var myContractQueryForm = null;
var myContractForm = null;
var myCsrGrid = null;
function buildInterface(){
//entire code for interface init will go here
myCustomerGrid = new dhtmlXGridObject("customerGrid");
myCustomerGrid.setImagePath("dhtmlxComponents/imgs/");
// myCustomerGrid.setHeader(“column0,column1,column2,column3,column4,column5,column6,column7,column8,column9,column10,column11,column12,column13”);
myCustomerGrid.setHeader(“客户,顾问,父亲,父亲职业,父亲单位,父亲工作电话,父亲手机,父亲电邮,母亲,母亲职业,母亲单位,母亲工作电话,母亲手机,母亲电邮,家庭座机,家庭地址,邮编,宝宝,来源,客户类型,级别,备忘录,操作”);
// myCustomerGrid.setHeader(“id, consultantI, father, fatherEmployment, fatherCell, mother, motherEmployment, motherCell,homePhone,customerBabiesInfo,howCome,type,memo”);
myCustomerGrid.setInitWidths(“100,60,60,150,150,60,60,150,60,150,150,60,60,150,60,150,50,150,60,50,50,150,100”);
// myCustomerGrid.setColAlign(“left,right,right”);
myCustomerGrid.setSkin(“light”);
myCustomerGrid.setDateFormat("%Y/%m/%d");
myCustomerGrid.init();
myCustomerGrid.load(“customerList.do”);
alert(“客户数据成功载入!”);
//init customerQueryForm
if (myCustomerQueryForm==null){
myCustomerQueryForm = new dhtmlXForm(“customerQueryForm”);
myCustomerQueryForm.loadStruct(“customerQueryForm.xml”);
myCustomerQueryForm.attachEvent(“onButtonClick”, function(name, command) {
if(name==“btnCreateCustomer”){
document.getElementById(“customerForm”).style.display = “block”;
document.getElementById(“customerGrid”).style.display = “none”;
document.getElementById(“customerQueryForm”).style.display = “none”;
myCustomerForm.setItemValue(“act”, “create”);
myCustomerForm.setItemLabel(“data”,“新建客户信息”);
} else if(name=="btnQueryCustomer"){
myCustomerQueryForm.send("queryCustomerList.do","post",
function(xml){
if( xml.xmlDoc.responseText!=null){
myCustomerGrid.clearAll();
myCustomerGrid.parse(xml.xmlDoc.responseText);
}
}
);
} else if(name=="btnReload") {
myCustomerGrid.clearAndLoad("customerList.do");
}//end of else if (name=="btnReload")
});// end of myCustomerQueryForm.attachEvent("onButtonClick"......
}
alert("客户信息查询提交表初始化成功!")
//init customerForm
myCustomerForm = new dhtmlXForm("customerForm");
myCustomerForm.loadStruct("customerForm.xml");
var consultantCombo = myCustomerForm.getCombo("consultant");
consultantCombo.loadXML("consultants.xml");
var customerCategoryCombo = myCustomerForm.getCombo("category");
customerCategoryCombo.loadXML("customerCategories.xml");
var customerTypeCombo = myCustomerForm.getCombo("type");
customerTypeCombo.loadXML("customerTypes.xml");
var howComeCombo = myCustomerForm.getCombo("howCome");
howComeCombo.loadXML("customerSources.xml");
myCustomerForm.attachEvent("onButtonClick", function(name, command) {
if(name=="btnSaveCustomer"){
myCustomerForm.send("saveCustomer.do",
"post",
function(xml){
if( xml.xmlDoc.responseText =="1") {
alert("客户保存成功!");
myCustomerGrid.clearAndLoad("customerList.do");
} else {
alert("客户保存失败!");
}
}
);
} else if (name=="btnBack2CustomerGrid"){
myCustomerForm.setReadonly("customerId",false);
document.getElementById("customerGrid").style.display = "block";
document.getElementById("customerQueryForm").style.display = "block";
document.getElementById("customerForm").style.display = "none";
}
});
alert("客户信息提交表初始化成功!")
//init babyForm
myBabyForm = new dhtmlXForm("babyForm");
myBabyForm.loadStruct("babyForm.xml");
myBabyForm.attachEvent("onButtonClick", function(name, command) {
if(name=="btnSaveBaby"){
myBabyForm.send("saveCustomerBaby.do",
"post",
function(xml){
if( xml.xmlDoc.responseText =="1") {
alert("宝宝保存成功!");
myBabyGrid.clearAndLoad("customerBabyList.do?customerId="+myBabyForm.getItemValue("customerId"),doAfterBabyListLoaded());
} else {
alert("宝宝保存失败!");
}
}
);
} else if (name=="btnBack2BabyGrid"){
document.getElementById("babyGrid").style.display = "block";
document.getElementById("babyGridButtonsForm").style.display = "block";
document.getElementById("babyForm").style.display = "none";
myBabyForm.setReadonly("babyName",false);
}
});//end of myBabyForm.attachEvent.......
alert("宝宝信息提交表初始化成功!")
//init customerContractForm
myCustomerContractForm = new dhtmlXForm("customerContractForm");
myCustomerContractForm.loadStruct("contractForm.xml");
myCustomerContractForm.getCombo("originalConsultant").loadXML("consultants.xml");
myCustomerContractForm.getCombo("currentConsultant").loadXML("consultants.xml");
myCustomerContractForm.getCombo("type").loadXML("contractTypes.xml");
myCustomerContractForm.getCombo("state").loadXML("contractStates.xml");
myCustomerContractForm.getCombo("packageSize").loadXML("contractPackages.xml");
myCustomerContractForm.attachEvent("onButtonClick", function(name, command) {
if(name=="btnSaveContract"){
myCustomerContractForm.send("saveContract.do",
"post",
function(xml){
if( xml.xmlDoc.responseText =="1") {
alert("合同保存成功!");
myCustomerContractGrid.clearAndLoad("customerContractList.do?customerId="+myCustomerContractForm.getItemValue("customer"),doAfterCustomerContractListLoaded());
} else {
alert("合同保存失败!");
}
}
);
} else if (name=="btnBack2ContractGrid"){
document.getElementById("customerContractGrid").style.display = "block";
document.getElementById("customerContractGridButtonsForm").style.display = "block";
document.getElementById("customerContractForm").style.display = "none";
//when upade, it was readonly, change it back to not readonly in case open the form for create new contract in future
myCustomerContractForm.setReadonly("contractId",false);
window.scrollTo(0,0);
}
});//end of myCustomerContractForm.attachEvent.......
alert("客户合同提交表初始化成功!")
//myContractGrid init
myContractGrid = new dhtmlXGridObject("contractGrid");
myContractGrid.setImagePath("dhtmlxComponents/imgs/");
myContractGrid.setHeader("录入,生效,合同,签约,服务,客户,爸爸,妈妈,宝宝,课包,赠课,价格,注册费,现金,银行卡,信用卡,已付,状态,类型,截至日,退课日期,退课金额,备忘录,操作");
myContractGrid.setInitWidths("65,65,100,60,60,60,60,60,120,40,40,50,50,50,50,50,50,50,50,65,65,60,150,100");
myContractGrid.setColTypes("dhxCalendar,dhxCalendar,ro,ro,ro,ro,ro,ro,ro,ro,ro,ron,ron,ron,ron,ron,ron,ro,ro,dhxCalendar,dhxCalendar,ron,ro,ro");
myContractGrid.setNumberFormat("0,000.00",11,".",",");
myContractGrid.setNumberFormat("0,000.00",12,".",",");
myContractGrid.setNumberFormat("0,000.00",13,".",",");
myContractGrid.setNumberFormat("0,000.00",14,".",",");
myContractGrid.setNumberFormat("0,000.00",15,".",",");
myContractGrid.setNumberFormat("0,000.00",16,".",",");
myContractGrid.setNumberFormat("0,000.00",21,".",",");
myContractGrid.setColAlign("left,left,left,left,left,left,left,left,left,right,right,right,right,right,right,right,right,left,left,left,left,right,left,left");
myContractGrid.setSkin("light");
myContractGrid.setDateFormat("%Y-%m-%d","%Y-%m-%d");
myContractGrid.init();
alert("合同数据表格初始化成功!")
//myContractGrid init
myCsrGrid = new dhtmlXGridObject("csrGrid");
myCsrGrid.setImagePath("dhtmlxComponents/imgs/");
myCsrGrid.setHeader("顾问, 合同数, 合同价格总金额, 注册费总计, 应付总金额, 现金总金额, 银行卡总金额, 信用卡总金额, 已付总金额, 合约平均金额, 合约平均已付金额,课程包总计, 赠课总计, 实际课程数总计, 赠课前均价, 赠课后均价 ");
myCsrGrid.setInitWidths("80,80,100,80,80,80,100,100,80,100,110,80,80,100,80,80");
myCsrGrid.setColTypes("ro,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron");
myCsrGrid.setNumberFormat("0,000.00",2,".",",");
myCsrGrid.setNumberFormat("0,000.00",3,".",",");
myCsrGrid.setNumberFormat("0,000.00",4,".",",");
myCsrGrid.setNumberFormat("0,000.00",5,".",",");
myCsrGrid.setNumberFormat("0,000.00",6,".",",");
myCsrGrid.setNumberFormat("0,000.00",7,".",",");
myCsrGrid.setNumberFormat("0,000.00",8,".",",");
myCsrGrid.setNumberFormat("0,000.00",9,".",",");
myCsrGrid.setNumberFormat("0,000.00",10,".",",");
myCsrGrid.setNumberFormat("0,000.00",14,".",",");
myCsrGrid.setNumberFormat("0,000.00",15,".",",");
myCsrGrid.setColAlign("left,right,right,right,right,right,right,right,right,right,right,right,right,right,right,right")
myCsrGrid.setSkin("light");
myCsrGrid.init();
//alert("合同统计数据表格初始化成功!")
//myContractForm init
myContractForm = new dhtmlXForm("contractForm");
myContractForm.loadStruct("contractForm.xml");
var currentConsultantCombo = myContractForm.getCombo("currentConsultant");
currentConsultantCombo.loadXML("consultants.xml");
var originalConsultantCombo = myContractForm.getCombo("originalConsultant");
originalConsultantCombo.loadXML("consultants.xml");
var contractStateCombo = myContractForm.getCombo("state");
contractStateCombo.loadXML("contractStates.xml");
var contractTypeCombo = myContractForm.getCombo("type");
contractTypeCombo.loadXML("contractTypes.xml");
myContractForm.getCombo("packageSize").loadXML("contractPackages.xml");
myContractForm.attachEvent("onButtonClick", function(name, command) {
if(name=="btnSaveContract"){
myContractForm.send("saveContract.do",
"post",
function(xml){
if( xml.xmlDoc.responseText =="1") {
alert("合同保存成功!");
myContractGrid.clearAndLoad("contractList.do",doAfterCustomerContractListLoaded());
} else {
alert("合同保存失败!");
}
}
);
} else if (name=="btnBack2ContractGrid"){
document.getElementById("csrGrid").style.display = "block";
document.getElementById("contractGrid").style.display = "block";
document.getElementById("contractQueryForm").style.display = "block";
document.getElementById("contractForm").style.display = "none";
//when upade, it was readonly, change it back to not readonly in case open the form for create new contract in future
myContractForm.setReadonly("contractId",false);
window.scrollTo(0,0);
}
});//end of myContractForm.attachEvent.......
//init myContractQueryForm
myContractQueryForm = new dhtmlXForm("contractQueryForm");
myContractQueryForm.loadStruct("contractQueryForm.xml");
myContractQueryForm.getCombo("currentConsultant").loadXML("consultants.xml");
myContractQueryForm.getCombo("originalConsultant").loadXML("consultants.xml");
myContractQueryForm.getCombo("contractIdSuffix").loadXML("contractIdSuffixes.xml");
myContractQueryForm.attachEvent("onButtonClick", function(name, command) {
if(name=="btnQueryContract"){
myContractQueryForm.send("queryContractList.do","post",
function(xml){
if( xml.xmlDoc.responseText!=null){
myContractGrid.clearAll();
myContractGrid.parse(xml.xmlDoc.responseText);
}
}
);
var queryMode = myContractQueryForm.getCheckedValue("queryMode");
if(queryMode=="business"){
document.getElementById("csrGrid").style.display = "block";
myContractQueryForm.send("queryContractStatistics.do","post",
function(xml){
if( xml.xmlDoc.responseText!=null){
myCsrGrid.clearAll();
myCsrGrid.parse(xml.xmlDoc.responseText);
}
}
);
}else{//swift search
document.getElementById("csrGrid").style.display = "none";
}
}
})//end of myContractQueryForm.attachEvent("onButtonClick".......
}
function doAfterGymbozTabInit() {
gymbozTab.attachEvent("onSelect", function(id,last_id){
if (id=="contractManagement"){
myContractGrid.clearAndLoad("contractList.do");
if (document.getElementById("csrGrid")!=null) {
document.getElementById("contractForm").style.display = "none";
document.getElementById("csrGrid").style.display = "block";
document.getElementById("contractQueryForm").style.display = "block";
document.getElementById("contractGrid").style.display = "block";
myCsrGrid.clearAndLoad("queryContractStatistics.do?queryMode=business");
}else{
alert("csrGrid is null");
}
} else if (id=="classManagement") {
}
return true;
});//gymbozTab.attachEvent
}
function onCustomerGridBabyButtonClick(customerId){
document.getElementById("customerQueryForm").style.display = "none";
document.getElementById("customerGrid").style.display = "none";
document.getElementById("babyGridButtonsForm").style.display="block";
document.getElementById("babyGrid").style.display = "block";
if (myBabyGrid==null){
myBabyGrid = new dhtmlXGridObject("babyGrid");
myBabyGrid.setImagePath("dhtmlxComponents/imgs/");
myBabyGrid.setHeader("宝宝,昵称,生日,性别,助记码,客户编号,爸爸,妈妈,操作,备忘录");
myBabyGrid.setInitWidths("150,150,150,150,150,150,150,150,150,250");
myBabyGrid.setSkin("light");
myBabyGrid.setColTypes("ro,ro,dhxCalendar,ro,ro,ro,ro,ro,ro,ro");
myBabyGrid.setDateFormat("%Y-%m-%d","%Y-%m-%d");
myBabyGrid.init();
//alert("myBabyGrid.init() finished");
}
myBabyGrid.clearAndLoad("customerBabyList.do?customerId="+customerId,doAfterBabyListLoaded());
if (myBabyGridButtonsForm==null){
myBabyGridButtonsForm = new dhtmlXForm("babyGridButtonsForm");
myBabyGridButtonsForm.loadStruct("babyGridButtonsForm.xml");
myBabyGridButtonsForm.attachEvent("onButtonClick", function(name, command) {
if(name=="btnBack"){
document.getElementById("customerQueryForm").style.display = "block";
document.getElementById("customerGrid").style.display = "block";
document.getElementById("babyGridButtonsForm").style.display="none";
document.getElementById("babyGrid").style.display = "none";
} else if(name=="btnCreateBaby"){
document.getElementById("babyForm").style.display = "block";
document.getElementById("babyGrid").style.display = "none";
document.getElementById("babyGridButtonsForm").style.display = "none";
myBabyForm.setItemValue("act", "create");
myBabyForm.setItemLabel("data","新建宝宝信息");
myBabyForm.setItemValue("customerId",customerId);
myBabyForm.setReadonly("customerId",true);
} //end of else if (name=="btnCreateBaby")
});// end of myBabyGridButtonsForm.attachEvent("onButtonClick"......
}
}
function onCustomerGridContractButtonClick(customerId){
document.getElementById("customerQueryForm").style.display = "none";
document.getElementById("customerGrid").style.display = "none";
document.getElementById("babyGridButtonsForm").style.display="none";
document.getElementById("babyGrid").style.display = "none";
document.getElementById("customerContractGridButtonsForm").style.display="block";
document.getElementById("customerContractGrid").style.display = "block";
if (myCustomerContractGrid==null){
myCustomerContractGrid = new dhtmlXGridObject("customerContractGrid");
myCustomerContractGrid.setImagePath("dhtmlxComponents/imgs/");
myCustomerContractGrid.setHeader("录入,生效,合同,签约,服务,客户,爸爸,妈妈,宝宝,课包,赠课,价格,注册费,现金,银行卡,信用卡,已付,状态,类型,截至日,退课日期,退课金额,备忘录,操作");
myCustomerContractGrid.setInitWidths("65,65,100,60,60,60,60,60,120,40,40,50,50,50,50,50,50,50,50,65,65,60,150,100");
myCustomerContractGrid.setSkin("light");
myCustomerContractGrid.setColTypes("dhxCalendar,dhxCalendar,ro,ro,ro,ro,ro,ro,ro,ro,ro,ron,ron,ron,ron,ron,ron,ro,ro,dhxCalendar,dhxCalendar,ron,ro,ro");
myCustomerContractGrid.setDateFormat("%Y-%m-%d","%Y-%m-%d");
myCustomerContractGrid.setNumberFormat("0,000.00",11,".",",");
myCustomerContractGrid.setNumberFormat("0,000.00",12,".",",");
myCustomerContractGrid.setNumberFormat("0,000.00",13,".",",");
myCustomerContractGrid.setNumberFormat("0,000.00",14,".",",");
myCustomerContractGrid.setNumberFormat("0,000.00",15,".",",");
myCustomerContractGrid.setNumberFormat("0,000.00",16,".",",");
myCustomerContractGrid.setNumberFormat("0,000.00",21,".",",");
myCustomerContractGrid.setColAlign("left,left,left,left,left,left,left,left,left,right,right,right,right,right,right,right,right,left,left,left,left,right,left,left");
myCustomerContractGrid.init();
}
myCustomerContractGrid.clearAndLoad("customerContractList.do?customerId="+customerId,doAfterCustomerContractListLoaded());
if (myCustomerContractGridButtonsForm==null){
myCustomerContractGridButtonsForm = new dhtmlXForm("customerContractGridButtonsForm");
myCustomerContractGridButtonsForm.loadStruct("customerContractGridButtonsForm.xml");
myCustomerContractGridButtonsForm.attachEvent("onButtonClick", function(name, command) {
if(name=="btnBack"){
document.getElementById("customerQueryForm").style.display = "block";
document.getElementById("customerGrid").style.display = "block";
document.getElementById("babyGridButtonsForm").style.display="none";
document.getElementById("babyGrid").style.display = "none";
document.getElementById("customerContractGridButtonsForm").style.display="none";
document.getElementById("customerContractGrid").style.display = "none";
document.getElementById("customerContractForm").style.display = "none";
} else if(name=="btnCreateContract"){
document.getElementById("customerContractForm").style.display = "block";
document.getElementById("customerContractGrid").style.display = "none";
document.getElementById("customerContractGridButtonsForm").style.display = "none";
myCustomerContractForm.setItemValue("act", "create");
myCustomerContractForm.setItemLabel("data","新建合同信息");
myCustomerContractForm.setItemValue("customer",customerId);
myCustomerContractForm.setReadonly("customer",true);
} //end of else if (name=="btnCreateContract")
});// end of myCustomerContractGridButtonsForm.attachEvent("onButtonClick"......
}
}
function onCustomerGridEditButtonClick(customerId) {
document.getElementById("customerForm").style.display = "block";
document.getElementById("customerGrid").style.display = "none";
document.getElementById("customerQueryForm").style.display = "none";
myCustomerForm.clear();
myCustomerForm.load("getCustomer.do?id="+customerId);
myCustomerForm.setItemValue("act", "update");
myCustomerForm.setItemLabel("data","修改客户信息");
myCustomerForm.setReadonly("customerId",true);
}
function onBabyGridEditButtonClick(babyId) {
document.getElementById("babyForm").style.display = "block";
document.getElementById("babyGrid").style.display = "none";
document.getElementById("babyGridButtonsForm").style.display = "none";
//myBabyForm.clear();
//alert(encodeURI("getBaby.do?id="+babyId));
myBabyForm.load(encodeURI("getBaby.do?id="+babyId));
//myBabyForm.load("getBaby.xml")
//alert(encodeURI("finish loading getBaby.do?id="+babyId));
myBabyForm.setItemValue("act", "update");
myBabyForm.setItemLabel("data","修改宝宝信息");
myBabyForm.setReadonly("customerId",true);
myBabyForm.setReadonly("babyName",true);
}
function onContractGridEditButtonClick(contractId) {
if (gymbozTab.getActiveTab()=="customerManagement") {
document.getElementById("customerContractForm").style.display = "block";
document.getElementById("customerContractGrid").style.display = "none";
document.getElementById("customerContractGridButtonsForm").style.display = "none";
//myCustomerContractForm.clear();
//alert(encodeURI("getContract.do?id="+contractId));
myCustomerContractForm.load(encodeURI("getContract.do?id="+contractId));
//alert(encodeURI("finish loading getContract.do?id="+contractId));
myCustomerContractForm.setItemValue("act", "update");
myCustomerContractForm.setItemLabel("data","修改客户合同信息");
myCustomerContractForm.setReadonly("customer",true);
myCustomerContractForm.setReadonly("contractId",true);
}else if (gymbozTab.getActiveTab()=="contractManagement") {
document.getElementById("contractForm").style.display = "block";
document.getElementById("contractGrid").style.display = "none";
document.getElementById("csrGrid").style.display = "none";
document.getElementById("contractQueryForm").style.display = "none";
//myContractForm.clear();
//alert(encodeURI("getContract.do?id="+contractId));
myContractForm.load(encodeURI("getContract.do?id="+contractId));
//alert(encodeURI("finish loading getContract.do?id="+contractId));
myContractForm.setItemValue("act", "update");
myContractForm.setItemLabel("data","修改客户合同信息");
myContractForm.setReadonly("customer",true);
myContractForm.setReadonly("contractId",true);
}
}
function doAfterBabyListLoaded(){
//alert("doAfterBabyListLoaded");
}
function doAfterCustomerContractListLoaded(){
//alert("doAfterCustomerContractListLoaded");
}
function ValidEmailOrEmpty(value){
if(!value)
return true;
return !!value.match(/(^[a-z]([a-z0-9_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\-\.]*)(\.[a-z]{2,3})$)/i);
}
function ValidNumericOrEmpty(value){
if(!value)
return true;
var reg = new RegExp("^[-]?[0-9]+[\.]?[0-9]+$");
return reg.test(value);
}
</script>