<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<select class="MySelect" name="Titleselect" onChange="fun(this.value)"> 
          <option>选择 </option> 
          <option value="aaaaa101.txt">S1 </option> 
          <option value="bbbbb201.txt">S2 </option> 
          <option value="ccccc301.txt">S3 </option> 
</select> <input type="text" name="AD1" id="L1" maxlength="40"> 
<input type="text" name="AD2" id="L2" maxlength="40"> 
<input type="text" name="AD3" id="L3" maxlength="40"> 
<input type="text" name="AD4" id="L4" maxlength="40"> 
<input type="text" name="AD5" id="L5" maxlength="40"> 
<script type="text/javascript">
function fun(val)
{
for(var i=1;i<6;i++)
{
var ipt = document.getElementById("L"+i);
ipt.value = val.replace(/(\d+)\./,function(str,n){
return parseInt(n,10)+i-1+".";
});
}
}
</script>
</body>
</html>