`
文章列表
<input type="text" value="3" maxlength="3" style="width : 30px;text-align: right;" onKeyUp="value=(parseInt((value=value.replace(/\D/g,''))==''?'0':value,10))" /> 代码分析: 1、onKeyUp 就是键盘松开后调用的事件。 2、/\D/g 这个就是我这里用的正则表达式。头尾的/符号表示这里面包 ...
/** * 判断非负数的整数或者携带一位或者两位的小数 * * @function: * @param obj * @return boolean * @exception * @author: * @since 1.0.0 */ public static boolean judgeTwoDecimal(Object obj){ boolean flag = false; try { if(obj != null){ String source = obj.t ...
1 数字:^[0-9]*$ 2 n位的数字:^\d{n}$ 3 至少n位的数字:^\d{n,}$ 4 m-n位的数字:^\d{m,n}$ 5 零和非零开头的数字:^(0|[1-9][0-9]*)$ 6 非零开头的最多带两位小数的数字:^([1-9][0-9]*)+(.[0-9]{1,2})?$ 7 带1-2位小数的正数或负数:^(\-)?\d+(\.\d{1,2})?$ 8 正数、负数、和小数:^(\-|\+)?\d+(\.\d+)?$ 9 有两位小数的正实数:^[0-9]+(.[0-9]{2})?$ 10 有1~3位小数的正实数:^[0-9]+(.[0 ...
/** * 处理数字:千位符、保留小数位数 * @param num 值 * @param del 小数位 * @param o o为true返回值为正数,否则为负数 * @returns {String} */ function RetainedDecimalPlaces (num, del, o) { try { num += ""; num = parseFloat(num).toFixed(del); //保留小数并四舍五入 var str = "" ...
$(document).ready(function() { /* JQuery 限制文本框只能输入数字和小数点 */ $("#fromAmount").bind("keyup", function(){ this.value = this.value.replace(/[^\d.]/g, ""); //必须保证第一个为数字而不是. this.value = this.value.replace(/^\./g, ""); ...
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> <script type="text/javascript" src ="http://code.jquery.com/jquery.js"></script> <style> t ...
package com.love; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; public ...
/** * 显示提示信息且在3秒后消失 * tipsContent :提示内容 */ tipsInfo : function(tipsContent){ /** 按钮设置为不可用 **/ $("#subBtn").prop('disabled', "disabled"); $(".addEmployeeTips").html(tipsContent).fadeI ...
http://www.cnblogs.com/mofish/archive/2012/11/30/2796698.html
转子Shooting Star百度空间 http://hi.baidu.com/620734263/item/19ef9b0c802bbfe5f55ba640
这个用于控制每个radiobutton之间的距离一致。 android:layout_weight="1" 以下3个属性是自定义radiobutton的图片 android:background="@null" android:button="@null" android:drawableLeft="@drawable/btn_radio_fee" 注意:不能使用android:layout_marginRight、android:paddingLeft      不管是在布局文件中还是在代码里写,不同的屏幕分 ...
public class SpecialCharTool { /** * 替换一个字符串中的某些指定字符 * * @param strData * String 原始字符串 * @param regex * String 要替换的字符串 * @param replacement * String 替代字符串 * @return String 替换后的字符串 */ public static String replaceString(String st ...
将之前用checkboxlist选择得到的值,即一个字符串(这个字符串是由","连接而成的),用.split(",")分割得到一个字符串数组String[] borrowArr ,把数组里的元素一个一个取出来,最好对其每个元素用.trim()遍历,以去掉可能存在的空格,把取出来的数据放在List集合中。之后把该list放在request作用域中. request.setAttribute("list",borrowArr ); 以上是action中的处理,对borrowArr 不需要另加setter/getter方 ...
在MyEclipse里面,要看被调用方法的内容 直接F3或者ctrl+鼠标点击。不过想查看方法在哪儿被调用了就不知道怎么回去了,用这个快捷键:ctrl+shift+g 或(ctrl+alt+h 这个组合键是后来发现的)可以搜索到被调用的类以及被那个方法调用了
<label id="emailAddressDefault" for="emailAddress" style="height:27px;font-weight:normal;padding-left:8px;width:230px;background:#fff;position:absolute;top:1px;left:1px;line-height:27px;color:#a2a2a2;" onclick="$(this).hide();">订阅中大奖,请输入您的Email</labe ...
Global site tag (gtag.js) - Google Analytics