Transcript WK12

Week 12
Today’s Objectives
 Announcements
•
Quiz 3 will be next week at the beginning of class
– JavaScript – Write a regular expression that checks for a valid year. (See the hint on
the next slide.)
– JavaScript – How do you add an inline event handler to the submit event of a form?
– HTTP – What number is returned as the HTTP status code when the server cannot
find the URL requested?
– ASP.NET – What attribute must be added to a regular HTML element to convert it
into an ASP.NET HTML server control?
•
Phase II of the team project is due next week – three bookstore
pages that use ASP.NET, including the home page, the sign-in page,
and the shipping information page
 ASP.NET
•
•
•
State management
Web controls
Validation controls
1
Week 12
JavaScript Regular Expressions
Can you answer the following question?
 Write the regular expression that is missing from the code below. Your
regular expression must be valid only for the years, 2008, 2009, and
2010. No other characters are allowed, not even white spaces.
Check your solution by adding the following JavaScript to a simple web page. If you need help, refer to
the slides in JavaScript2.html and the web page at http://www.regular-expressions.info/dates.html
function validateExpireYear() {
var input = document.getElementById("input");
if (input.value.match(______________________)) {
alert('valid');
}
else {
alert('NOT valid');
}
}
2