|
When clicked, the function form_edit() performs the following test on the user data
- Book Title is a 4 row 40 column textarea named bt. Be sure the user enters only upper and lower case letters A through Z (i.e., ASCII 65 is A;...thru...90 is Z; 97 is a;...thru...122 is z). If any other characters are encountered in bt, replace then with a blank space. If the user enters string is longer than 160 bytes, keep only the first 160 bytes. An empty textarea stops the form submission and the message "Book Title cannot be empty" is displayed.
- The three Author fields (named a1, a2, and a3) require the same A-Z,a-z edit as the Book Title above. An empty textbox for the first author (i.e., a1) stops the form submission and the error message "Author 1 cannot be blank" is displayed. a2 and a3 may be empty.
- ISBN -- no edits.
- Number of Copies -- no edits.
- Hard/Soft Cover -- no edits.
If there are no errors submit the form.
Write only the javascript for form_edit. |