{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-09-10T02:13:49-04:00", "answer_date": "2024-09-10 02:13:49", "is_docs_available": "", "is_excel_available": "", "is_pdf_available": "", "count_file_available": 0, "main_page": "student_question_view", "question_id": "9961298", "url": "\/study-help\/questions\/modify-the-code-of-listing-91-to-also-validate-that-9961298", "question_creation_date_js": "2024-09-10T02:13:49-04:00", "question_creation_date": "Sep 10, 2024 02:13 AM", "meta_title": "[Solved] Modify the code of Listing 9.1 to also va | SolutionInn", "meta_description": "Answer of - Modify the code of Listing 9.1 to also validate that the phone field of the form is not blank. Have the program produc | SolutionInn", "meta_keywords": "modify,code,listing,9.1,validate,phone,field,form,blank,program,produce,one", "question_title_h1": "Modify the code of Listing 9.1 to also validate that the phone field of the form is not blank. Have the program produce only one", "question_title": "Modify the code of Listing 9.1 to also validate that the phone", "question_title_for_js_snippet": "Modify the code of Listing 9 1 to also validate that the phone field of the form is not blank Have the program produce only one alert message, saying which field(s) require attention Canceling Default Behavior function checkform() document getElementById( form1 ) onsubmit function() var allowSubmit true if( document getElementById( user ) value ) alert( Name field cannot be blank ) allowSubmit false if(allowSubmit) alert( Data OK submitting form ) return allowSubmit window onload checkform Name Required field Phone Optional field ", "question_description": "

Modify the code of Listing 9.1 to also validate that the phone field of the form is not blank. Have the program produce only one alert message, saying which field(s) require attention.<\/p>

Canceling Default Behavior <\/title> <script> function checkform() { document.getElementById(\"form1\").onsubmit = function() { var allowSubmit = true; if( document.getElementById(\"user\").value == \"\") { alert(\" Name field cannot be blank \"); allowSubmit = false; } if(allowSubmit) alert(\" Data OK - submitting form \"); return allowSubmit; } } window.onload = checkform; <script> <\/head> <body> <form id =\"form1\"> Name: <input type =\"text\" value =\"\" name =\" username\" id =\" user\"\/> [Required field] <br\/> Phone: <input type =\" text\" value =\"\" name =\"telephone\" id =\"phone\"\/> [Optional field] <br\/> <input type =\" submit\"\/> <\/form> <\/body> <\/html><\/p>", "transcribed_text": "", "related_book": { "title": "Case Studies In Business Data Bases", "isbn": "0030141346, 978-0030141348", "edition": "1st Edition", "authors": "James Bradley", "cover_image": "https:\/\/dsd5zvtm8ll6.cloudfront.net\/si.question.images\/book_images\/6509613e726c7_55546.jpg", "uri": "\/textbooks\/case-studies-in-business-data-bases-1st-edition-9780030141348", "see_more_uri": "\/textbooks\/computer-science-azure-2416" }, "question_posted": "2024-09-10 02:13:49", "step_by_step_answer": "The Answer is in the image, click to view ...", "students_also_viewed": [ { "url": "\/tyler-service-co-experienced-the-following-transactions-for-2014-its", "description": "Tyler Service Co. experienced the following transactions for 2014, its first year of operations: 1. Provided $86,000 of services on account. 2. Collected $72,000 cash from accounts receivable. 3....", "stars": 3 }, { "url": "\/study-help\/introduction-to-probability-statistics\/877-independent-random-samples-of-n-n-n-1985754", "description": "8.77 Independent random samples of n = n = n observations are to be selected from each of two bino- mial populations 1 and 2. If you wish to estimate the difference in the two population proportions...", "stars": 3 }, { "url": "\/1-what-would-be-the-reasons-for-and-against-christina", "description": "1. What would be the reasons for and against Christina and David Sloan working for Tortilla King? 2. What advice would you offer Sloan?", "stars": 3 }, { "url": "\/study-help\/questions\/6-homework-music-mineralid-1-geolog-history-of-rock-cho-10088034", "description": "6 Homework MUSIC MineralID 1 geolog History of Rock Cho Saved B Piedmont Company segments its business into two regions --North and South. The company prepared the contribution format segmented...", "stars": 3 }, { "url": "\/study-help\/questions\/direct-materials-purchases-budget-direct-labor-budget-macchu-company-produces-7413059", "description": "Direct Materials Purchases Budget: Direct Labor Budget Macchu Company produces stuffed toy animals; one of these is \"Andie the Liama,\" Each Andie takes 0 . 20 yard of fabric (white with irregular...", "stars": 3 }, { "url": "\/study-help\/questions\/if-quality-airline-cuts-its-domestic-fares-by-20-1621759", "description": "If Quality Airline cuts its domestic fares by 20%, A) profit will increase by 20%. B) a profit can only be earned by decreasing the quantity of flights. profits can be maintained either by increasing...", "stars": 3 }, { "url": "\/study-help\/questions\/you-have-an-opportunity-to-invest-in-australia-at-an-1624919", "description": "You have an opportunity to invest in Australia at an interestrate of 0.070. Moreover, you expect the Australian dollar (A$) toappreciate by 0.020. Your effective return from this investmentis:", "stars": 3 }, { "url": "\/study-help\/questions\/hr-management-at-innovatetech-solutions-innovatetech-solutions-is-a-dynamic-5309315", "description": "HR Management at InnovateTech Solutions InnovateTech Solutions is a dynamic and forward-thinking technology company, specialising in software development. It was first established in 2021 and has...", "stars": 3 }, { "url": "\/study-help\/questions\/which-process-requires-intricate-planning-in-terms-of-procurement-policies-1625786", "description": "Which process requires intricate planning in terms of procurement policies and the manufacturing process? Six Sigma JIT Production TQM Value Analysis", "stars": 3 }, { "url": "\/study-help\/questions\/the-following-condensed-balance-sheet-is-for-the-partnership-of-1593099", "description": "The following condensed balance sheet is for the partnership of Ludolf, Sambal, and Urad, who share profits and losses in the ratio of 6:2:2, respectively: Cash Other assets $ 49,000 135,000...", "stars": 3 }, { "url": "\/study-help\/intercultural-communication\/b-drinking-on-the-job-is-frowned-on-in-corporate-2116090", "description": "B Drinking on the job is frowned on in corporate America. But at workrelated lunches and dinners, businesspeople often run up considerable bar tabs. Why might alcohol be encouraged in one setting but...", "stars": 3 }, { "url": "\/study-help\/intercultural-communication\/do-you-have-any-relationships-that-exist-strictly-online-do-2116085", "description": "Do you have any relationships that exist strictly online? Do you consider these relationships different from other ones in your life? Are they more intimate or less?", "stars": 3 }, { "url": "\/study-help\/intercultural-communication\/do-you-rely-on-different-relational-partners-for-companionship-stimulation-2116086", "description": "Do you rely on different relational partners for companionship, stimulation, or goal achievement? Do you have some relationships that provide all three functions?", "stars": 3 } ], "next_back_navigation": { "previous": "\/study-help\/questions\/cane-company-manufactures-two-products-called-alpha-and-beta-that-9961297", "next": "\/study-help\/questions\/could-you-please-solve-this-problem-and-break-down-your-9961299" }, "breadcrumbs": [ { "name": "Study help", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers" }, { "name": "Computer Science", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers\/computer-science" }, { "name": "Databases", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/computer-science-databases" }, { "name": "Modify the code of Listing 9.1 to also validate that the phone", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/modify-the-code-of-listing-91-to-also-validate-that-9961298" } ], "skill_details": { "skill_id": "656", "skill_name": "Databases", "parent_id": "8" } }