var feet = 0; var inch = 0; var cms = 0; $('.feet').each(function () { if ($(this).val() != '' && $.isNumeric($(this).val())) { inch = parseFloat($(this).val() * 12); cms = parseFloat($(this).val() * 30.48); } }); if (inch != 0 && cms != 0) { $("#<%=txtInches.ClientID%>").val(inch); $("#<%=txtCms.ClientID %>").val(cms); } else { $("#<%=txtInches.ClientID%>").val(''); $("#<%=txtCms.ClientID %>").val(cms); } return false; working above code ----------------------------------------------------------------------------------- $('.inch').each(function () { if ($(this).val() != '' && $.isNumeric($(this).val())) { feet = parseFloat($(this).val() * 0.08); cms = parseFloat($(this).val() * 2.54); alert(parseFloat($(this).val() * 0.08)); alert(cms); } }); if (feet != 0 && cms != 0) { $("#<%=txtFeet.ClientID%>").val(feet); $("#<%=txtCms.ClientID %>").val(cms); } else { $("#<%=txtInches.ClientID%>").val(''); $("#<%=txtCms.ClientID %>").val(''); } return false;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)