To complete this project, follow the instructions below.
- js/script.js
- jquery
- css/reset.css or css/nomralize.css
- Utilize jQuery while coding the functionality for your form.
- When the page loads, give focus to the first text field
- Include a text field that will be revealed when the "Other" option is selected from the "Job Role" drop down menu.
- Give the field an id of “other-title,” and add the placeholder text of "Your Job Role".
- For the T-Shirt "Color" menu, only display the color options that match the design selected in the "Design" menu.
- If the user selects "Theme - JS Puns" then the color menu should only display "Cornflower Blue," "Dark Slate Grey," and "Gold."
- If the user selects "Theme - I ♥ JS" then the color menu should only display "Tomato," "Steel Blue," and "Dim Grey."
- When a new theme is selected from the "Design" menu, the "Color" field and drop down menu is updated.
- Some events are at the same day and time as others. If the user selects a workshop, don't allow selection of a workshop at the same day and time -- you should disable the checkbox and visually indicate that the workshop in the competing time slot isn't available.
- When a user unchecks an activity, make sure that competing activities (if there are any) are no longer disabled.
- As a user selects activities, a running total should display below the list of checkboxes. For example, if the user selects "Main Conference", then Total: $200 should appear. If they add 1 workshop, the total should change to Total: $300.
- Display payment sections based on the payment option chosen in the select menu.
- The "Credit Card" payment option should be selected by default. Display the #credit-card div, and hide the "PayPal" and "Bitcoin" information. Payment option in the select menu should match the payment option displayed on the page.
- When a user selects the "PayPal" payment option, the PayPal information should display, and the credit card and “Bitcoin” information should be hidden.
- When a user selects the "Bitcoin" payment option, the Bitcoin information should display, and the credit card and “PayPal” information should be hidden.
- If any of the following validation errors exist, prevent the user from submitting the form:
- Name field can't be blank.
- Email field must be a validly formatted e-mail address (you don't have to check that it's a real e-mail address, just that it's formatted like one: [email protected] for example.)
- User must select at least one checkbox under the "Register for Activities" section of the form.
- If the selected payment option is "Credit Card," make sure the user has supplied a Credit Card number, a Zip Code, and a 3 number CVV value before the form can be submitted.
- Credit Card field should only accept a number between 13 and 16 digits.
- The Zip Code field should accept a 5-digit number.
- The CVV should only accept a number that is exactly 3 digits long.
- Provide some kind of indication when there’s a validation error. The field’s borders could turn red, for example, or even better for the user would be if a red text message appeared near the field.
- The following fields should have some obvious form of an error indication:
- Name field
- Email field
- Register for Activities checkboxes (at least one must be selected)
- Credit Card number (Only if Credit Card payment method is selected)
- Zip Code (Only if Credit Card payment method is selected)
- CVV (Only if Credit Card payment method is selected)
-[x] When JavaScript is switched off or unavailable, the user should still have access to all form fields and payment information. For example, the “Other” text field in the "Job Role" menu should be visible on the page when JavaScript is switched off, and all information for Bitcoin, Paypal or Credit Card payments should be visible.
- Hide the "Color" label and select menu until a T-Shirt design is selected from the "Design" menu.
- Program at least one of your error messages so that more information is provided depending on the error. For example, if the user hasn’t entered a credit card number and the field is completely blank, the error message reads “Please enter a credit card number.” If the field isn’t empty but contains only 10 numbers, the error message reads “Please enter a number that is between 13 and 16 digits long.”
- Program your form so that it provides a real-time validation error message for at least one text input field. Rather than providing an error message on submit, your form should check for errors and display messages as the user begins typing inside a text field. For example, if the user enters an invalid email address, the error appears as the user begins to type, and disappears as soon as the user has entered a complete and correctly formatted email address. You must accomplish this will your own JavaScript code. Do not rely on HTML5's built-in email validation.