|
home—lects—exams—hws
breeze (snow day)
Due: 2011.Oct.17 (Mon) 19 (Wed) 23:59.
We will further improve on hw03—Server side validation's .W.o.W. page by adding client-side validation, and making the form a sticky form.
Note:(A hw03-soln and your hw03 grades will be ready in the next couple of days — Oct.09)If the input field fails validation, dynamically modify the html page to insert (or remove/zero-out) an error message. Use css to control the style of the error message.
Note: The notes with the javascript for dynamically adding nodes to the DOM will be added to the web page by Sun. eve (Oct.09). Remember, though, code to modify the page is should be independent of functions that validate and create the string to be used for any error message.
Since these two options are mutually-exclusive, when a user selects one the other checkbox should be disabled23
Make your page look neat and professional! You are encouraged to make your javascript code as similar as possible as the php-validation code, including wrapper functions to abstract away the differences.
1 True, if they came from the form and we had client-side error checking on, then theoretically there could be no errors server-side. However, we'll deal later with some validation that might only happen server-side, such as looking up login info in a database. In these cases, it's important that the form be sticky. ↩
2You disable an DOM input field by setting its attribute
3 Usually, radio-buttons are used for mutually exclusive options, though in this case you'd need three. However, for this hw you are required to use checkboxes that are dynamically disabled, to learn that skill. ↩
4 If you want to make your function even more general-purpose, you might pass in an additional value indicating whether the drop-down menu has an initial "please choose" or "--" neutral option, and perhaps whether or not the drop-down selection is required with any client-side check auto-coded, cool! ↩
5
If you want to make your function even more general-purpose,
you might have your function return an array of html-for-checkboxes,
so that the caller can insert those checkboxes
horizontally or in a table or with
6the function to show-source a file is one of the few exceptions ↩
home—lects—exams—hws
breeze (snow day)
©2011, Ian Barland, Radford University Last modified 2011.Oct.17 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |