<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script language="javascript">
$(function(){
var format = '{RC_001} = {RC_002}+{RC_003}*{RC_004}';
var str = format.substr(1,format.indexOf("=")-3);
var str_value = format.substr(format.indexOf("=")+1,format.length);
var arr = str_value.match(/\{(\w*)\}/g);
for(var i=0;i<arr.length;i++)
{ arr[i]= arr[i].substr(1,arr[i].length-2);
$("#"+arr[i]).bind('blur',function(){
var temp = str_value.replace(/\{(\w*)\}/g,function(m ,i){
return "" == $("#"+i).val() ? 0 : new Number($("#"+i).val());
})
$("#"+str).val(eval(temp));
})
}
})
</script>
</head>
<body>
<form>
<input type="text" id="RC_001" width="120px">
<input type="text" id="RC_002" width="120px">
<input type="text" id="RC_003" width="120px">
<input type="text" id="RC_004" width="120px">
<input type ="button" value="确定" οnclick="show()">
</form>
</body>
</html>