1.从HTMl页面call回到javascript的function
如: <input type="text" name="from" id="from" maxlength="5" placeholder="day-month" title="Optional" onkeyup="checkDate(this)"/>
function checkDate(caller){
var that = $(caller);
if(caller.id == 'from' || caller.id == 'to'){
if(caller.value.match(/^[0-9 -]+$/g)){that.css('border','none');}
else if(caller.value == ""){that.css('border','none');}else{that.css('border','red 1px solid');}
}