7.6.1: Form validation. Jump to level 1 Use HTML5 validation attributes to ensure the entered age is between 15 and 65, inclusive, and the user name is 15 characters or less. <form> <label for="userAge">User Age:</label> <input id="userAge" type="number" name="age"><br> <label for="userName">User Name:</label> <input id="userName" type="text" name="username"><br> <input type="submit"> </form>
Added by Victoria M.
Close
Step 1
Use the HTML5 validation attributes to ensure the entered age is between 15 and 65, inclusive. Show more…
Show all steps
Your feedback will help us improve your experience
Supreeta N and 101 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
(This needs to be coded using Python) Write and test a program that accepts the user’s name (as text) and age (as a number) as input. The program should output a sentence containing the user’s name and age. An example of the program input and output is shown below:Enter your name: Alex Enter your age: 23 Alex is 23 years old.
Shelayah R.
In PyCharm, write a program that prompts the user for their name and age. Your program should then tell the user the year they were born. Here is a sample execution of the program with the user input in bold: What is your name? Amanda How old are you? 15 Hello Amanda! You were born in 2005. Write the program. Format your code using best practices. Refer to the zyBooks style guide, if needed, to use proper naming conventions for variables and methods. Use the most appropriate statements with minimal extraneous elements, steps, or procedures. Run the program. Debug the program. Be sure your code produces the correct results. Save and submit your file.
Akash M.
Write an expression that will cause the following code to print "18 or less" if the value of user_age is 18 or less. Write only the expression. Sample output with input: 17 user_age = int(input()) print("18 or less") if user_age <= 18 else print("Over 18")
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD