如何在JavaScript中實現下面的僞代碼?我想在第二個代碼摘錄中包含日期檢查,其中txtDate用於BilledDate。JavaScript中的日期解析和驗證
If ABS(billeddate – getdate) > 31 then yesno 「The date you have entered is more than a month from today, Are you sure the date is correct,」.
if (txtDate && txtDate.value == "")
{
txtDate.focus();
alert("Please enter a date in the 'Date' field.")
return false;
}
不使用的字符串操作的數學 – StingyJack 2008-10-27 15:35:33