js

<script>

function spec_sub(count){
  var d = document.getElementsByName('radio');
  for(var i=0;i<d.length;i++){
   if(d[i].checked == true){
    document.form1.defaultSpec.value = d[i].value;
   }
  }
 regexpdat=/^/d+$/;
 for(var i=0;i<count;i++){
  var num=document.getElementById('num'+i);
  var openPrice=document.getElementById('openPrice'+i);
  var price=document.getElementById('price'+i);
  if(parseFloat(price.value)>parseFloat(openPrice.value)){
     alert('本店价格不能大于市场价格');
     return false;
  }
  if(!regexpdat.test(num.value)||num.value==0){
      alert('库存应为正整数');
   return false;
  }
 }
 document.form1.action='product.shtml?method=submitProductSpec';
 document.form1.submit();
 return false;
}
</script> 

<form name="form1" method="post" action="product.shtml?method=submitProductSpec">

 <table width="763" border="0" cellpadding="0" cellspacing="0">

    #set($count = 0)
    #foreach($pspec in $specList)
    <tr>        
      <td class="zhright6"><input type='text' size='5' id='openPrice$!count'  name='spec_${pspec.id}_openPrice' value='$!{number.format('0.00',$!pspec.openPrice)}' />
      </td><!--市场价格-->
      <td class="zhright6"><input type='text' size='5' id='price$!count' name='spec_${pspec.id}_price' value='$!{number.format('0.00',$!pspec.price)}' /></td>
      <td class="zhright6"><input type='text' size='5' id='num$!count' name='spec_${pspec.id}_num' value='$!{pspec.num}' /></td><!--库存-->
      <td class="zhright6"><a href="#" οnclick="spec_add(${pspec.id});return false;">复制</a> | <a href="#" οnclick="spec_del(${pspec.id});return false;">删除</a></td>
    </tr>
   #set($count = 1 + $count)
   <tr>
    <td colspan="9"><img src="images/zhright_xian.jpg" /></td>
   </tr>
    #end

</table>
       <td align="left" width="68" height="18"><input type="button" class="products_set" value="保 存" οnclick="spec_sub($count);return false;" #if($count == 0) disabled #end></td>
</form>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值