过滤字符串 和 select选择后控件值变更

 

过滤字符串

function removeChkStr(chkId){
return chkId.replace(new RegExp("chk_item"), "");
}

 

select选择后控件值变更:

<script type="text/javascript">
$(document).ready(function(){
$('#coupon_list').change(function(){
var aa=$(this).children('option:selected').val();
$('#coupon_code').val(aa);
});
})
</script>

<select id="coupon_list" style="width: 145px; margin-right: -152px; padding: 2px;" >
<option class="c-option" value="0" selected="selected">0</option>
<option class="c-option" value="123" >123</option>
</select>
<div>
<input class="input-text" id="coupon_code"style="width: 124px;_width: 135px;height: auto;_height: 17px;border: 0;padding: 0;_padding-top: 3px;_border: 1px solid #ccc;" name="coupon_code" value="coupon_code" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">


</div>

posted @ 2014-01-17 17:47  lifeinearth  阅读(169)  评论(0编辑  收藏  举报