asp高手们帮忙看一下代码,想实现将部分文本框内的字符串经过处理后生成一个产品编码
<body><scriptlanguage="javascript">functioncpbm(){varbmgys=document.getElementById("g...
<body>
<script language="javascript">
function cpbm(){
var bmgys=document.getElementById("gys").value;
var bmjg=document.getElementById("cpdj").value;
bmjg=bmjg+"000000"
var bmssrq=document.getElementById("ssrq").value.substr(2,8);
bmssrq=bmssrq.replace("-","");
document.getElementById("cpbm").value = bmgys+bmjg+"T"+bmssrq;
}
</script>
<form action="products_add_ok.asp" method="post" name="myform">
<div class="description">
在此页面添加新产品及产品详细信息!</div>
<p>
<strong>产品单价</strong>
<input id="cpdj" name="cpdj" type="text" size="60" />
</p>
<p>
<strong>供 应 商</strong>
<select name="gys" size="1">
<option value="">请选择...</option>
<% do while not rs.EOF%>
<option value="<%=rs("gysbh")%>"><%=rs("gysmc")%></option>
<%rs.movenext
loop %>
</select>
</p>
<p>
<strong>上市日期</strong>
<input name="ssrq" id="ssrq" type="text" size="60" onClick="WdatePicker()"/>
</p>
<p><strong>产品编码</strong>
<input id="cpbm" name="cpbm" type="text" size="60" onfocus="cpbm();"/>
<p>
<strong>产品图片1</strong>【尺寸:800x450】<br/>
<input id="img1" name="img1" type="text" size="60" />
<input type="button" value="浏览..." onclick="BrowseServer( 'Images:/', 'img1' );" />
</p>
<p>
<input type="button" value="添加产品" onClick="check(myform)"/>
</p>
</body>
</html> 展开
<script language="javascript">
function cpbm(){
var bmgys=document.getElementById("gys").value;
var bmjg=document.getElementById("cpdj").value;
bmjg=bmjg+"000000"
var bmssrq=document.getElementById("ssrq").value.substr(2,8);
bmssrq=bmssrq.replace("-","");
document.getElementById("cpbm").value = bmgys+bmjg+"T"+bmssrq;
}
</script>
<form action="products_add_ok.asp" method="post" name="myform">
<div class="description">
在此页面添加新产品及产品详细信息!</div>
<p>
<strong>产品单价</strong>
<input id="cpdj" name="cpdj" type="text" size="60" />
</p>
<p>
<strong>供 应 商</strong>
<select name="gys" size="1">
<option value="">请选择...</option>
<% do while not rs.EOF%>
<option value="<%=rs("gysbh")%>"><%=rs("gysmc")%></option>
<%rs.movenext
loop %>
</select>
</p>
<p>
<strong>上市日期</strong>
<input name="ssrq" id="ssrq" type="text" size="60" onClick="WdatePicker()"/>
</p>
<p><strong>产品编码</strong>
<input id="cpbm" name="cpbm" type="text" size="60" onfocus="cpbm();"/>
<p>
<strong>产品图片1</strong>【尺寸:800x450】<br/>
<input id="img1" name="img1" type="text" size="60" />
<input type="button" value="浏览..." onclick="BrowseServer( 'Images:/', 'img1' );" />
</p>
<p>
<input type="button" value="添加产品" onClick="check(myform)"/>
</p>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询