Validate and Process a Web Form:Collect the users name, complete address, date of birth, phone number, email address, username and password using textboxes.
You will be graded on the form appearance as well as the use of ASP web forms, using C# to process the form, using validation controls to validate the form, as well as the level of configuration, difficulty and integration with content on the page.
- In the pages folder, add a web form using your master page, and name the page Week2.aspx.
- This week you are to create a web form. Use only Web Server controls for the form fields (Not HTML Controls!). You may use HTML controls for the layout of the form.
- The form should have the labels lined up and easy to enter the data.
- The form fields and all web controls with ids, should have descriptive names.
- Use proper indentation and comments for the major sections of your code.
- The heading on the page should be “Membership Signup Page”
- Include directions for the user indicating the form input requirements.
- Collect the users name, complete address, date of birth, phone number, email address, username and password using textboxes. The state can be a dropdown list.
- Dropdown lists should identify what age group the user belongs to: child, teenager, adult.
- Radiobuttons should be used to identify gender: male, female, no response
- Radiobuttons should be used to identify user preference: audio, hardcover, paperback
- Checkboxes should provide a list the titles of the five The New York Times Best Sellers from http://www.nytimes.com/books/best-sellers/.
- Dropdown lists should provide a list of at least 6 genres: mystery, fiction, science fiction, non-fiction, biography, historical, children’s, poetry, adventure, fantasy, contemporary, romance, novel, gothic. science, informational, traditional literature, classics. The user should be able to pick multiple genres.
- Include a button to submit the form.
- One textbox should allow the user to enter comments across multiple lines of text.
- Valid credit card number and type, expiration date and CV code.
- User ID should be assigned to the new member and displayed to the user. They should not be able to change the iD.
You may want to visit http://www.regular-expressions.info/creditcard.html (Links to an external site.)Links to an external site. or other web site to locate sample code numbers for credit cards and the regular expressions used.
Validate the form data using validation controls.
- All fields are required.
- the password is shown as a password with asterisks.
- The email is a valid format.
- The user name is strong and at least 10 characters and a mix of upper, lower and special characters and numbers.
- The zip code cannot be alpha characters.
- The birthdate myst be a valid date and after 1900.
- Use a validation summary control to show all the errors in one location on the page.
Send the output to the client.
- Use Page.IsPostback to determine if the user has completed the form. If they have not been there before, display the form. If the form is completed and valid, hide the form and show the results nicely formatted to the user.
- If the form is valid, then show the user what the values were and indicate that the form was successfully submitted. If the form was not valid, display appropriate error messages.