jquery カレンダーの日付ピッカーを使用して入力テキスト ボックスを検証しようとしています。日付ピッカー自体はうまく機能しますが、入力が mm/dd/yyyy 形式であることを検証する方法がわかりません。コンテンツが別の jsp からロードされているため、これはこのようにセットアップされます。
ここに入力があります。
<table class="style2" width="100%">
<tr>
<td width="291" valign="middle">
<p>Date: <input type="text" class="followup_three_02" id="followup_three_02" maxlength="10" size="10" value="<%=session.getAttribute("followup_three_02")==null?"":session.getAttribute("followup_three_02")%>" />
</td>
<td width="246">
</td>
</tr>
</table>
そして日付ピッカー
function showContent(pos,direction){
$("#area").hide("slide", { direction: direction=="left"?"right":"left"}, 500,
function(){
$("#area").load("3month_forms.jsp #area" + pos, function(){
$("#area").show("slide", { direction: direction }, 500);
if(pos==2){
$(function(){
var pickerOpts = {
showOn: "button",
buttonImage: "/images/calendar.png",
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
yearRange: "-60:+0"
};
$("#followup_three_02").datepicker(pickerOpts);
});
}
});
}
);
}
私のバリデーターは正しくありません。
}else if(question_pos==2){
if($('#followup_three_02').val() == ( Date.parse("4/8/2013") > Date.now())){
alert("What is your baby's birthdate? ");
return false;