if a user inputs a date in the text field witht the wrong format..how i can i make an error message that will catch the error that the input date format is wrong?
please answer me..asap
please answer me..asap
//BALALALALA CODE
// CODE TO RECEIVE THE USER date INPUT
String dateReceived = req.getParameter("myDate");
java.sql.Date progDate = null;
try{
progDate = java.sql.Date.valueOf(dateReceived);
}catch(DateFormatException dtfe){
//code for program flow after an invalid date is receved
}
Comment