I have a JavaScript validation function that checks to make sure that each combobox has had a selection made in it. Here is that code:
If this function returns true, I want this additional function to run. How do I do this? Thanks in advance.Code:function checkform() { var TWIndex=document.TireDiameterForm.TireWidth.selectedIndex; var SWIndex=document.TireDiameterForm.SideWall.selectedIndex; var WDIndex=document.TireDiameterForm.WheelDiameter.selectedIndex; if (TWIndex==0){ alert('There is a problem with the Tire Width field'); return false;} else if (SWIndex==0) { alert('There is a problem with the Sidewall field'); return false;} else if (WDIndex==0) { alert('There is a problem with the Wheel Diameter field'); return false;} return true; }
Code:function TireDiameter() { var mm=.0393701 var w = document.TireDiameterForm.TireWidth.value; var s = document.TireDiameterForm.SideWall.value; var d = document.TireDiameterForm.WheelDiameter.value; var y = Math.round((((((w * s) / 100) * 2) * mm) + (d * 1)) * 100) / 100; document.TireDiameterForm.Result.value = y;}



Reply With Quote

Bookmarks