{"id":54729,"date":"2021-09-30T17:39:09","date_gmt":"2021-09-30T17:39:09","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/09\/30\/button-with-a-loop-javascript\/"},"modified":"2021-09-30T17:39:09","modified_gmt":"2021-09-30T17:39:09","slug":"button-with-a-loop-javascript","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/09\/30\/button-with-a-loop-javascript\/","title":{"rendered":"Button with A Loop (Javascript)"},"content":{"rendered":"<p> After the form, there should be a button that activates the JavaScript, which should be in a function. This function should perform a variety of actions depending on the values entered by the user, according to the following criteria below.<br \/> There must also be a paragraph with an ID attribute used for output from the calculation.<\/p>\n<p> Your form should have the following fields:<br \/> \u25cf Two text fields where the user can enter the names of two different people. (Text)<br \/> \u25cf There must be a password field. (Password)<br \/> \u25cf There must be a number field where the user can enter a number. This number should be used in a loop in the JavaScript. (Number)<br \/> \u25cf There must be a CheckBox that indicates whether the user wants a repeat of his output or not. (Checkbox)<\/p>\n<p> When the user presses the button, the following must be performed:<br \/> \u25cf First, the Script should check that at least one name has been entered in the name text fields. If none of the fields have a text, an error message will be printed to the user and the script will end. (Undefined)<br \/> \u25cf Then the value in the password field should be checked. If the entered password is \u201cKYH\u201d then the Script should continue. Otherwise, it should print an error message to the user and then quit. (If)<br \/> \u25cf The two names of the people should be saved in an Array. If the user has only entered a name in one of the fields, only one name should be saved in the array. (Array)<br \/> \u25cf 2 more names must be added as values in the array; the names \u201cMarcus\u201d and \u201cCihan\u201d. (Push)<br \/> \u25cf A greeting message to all the names in the array should be printed once for a paragraph tag. (ForEach)<br \/> \u25cf If the user has chosen to tick repeatedly, the greeting message must be printed again for all persons in the array as many times as the user has entered in their number field. (For)<\/p>\n<p> Your script should also include comments describing the process.I&#8217;ve already made the text field, number field and the checkbox but I don&#8217;t understand how to go on from there.<br \/> I&#8217;ve tried by myself but I just simply can&#8217;t. I really need help with this assignment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After the form, there should be a button that activates the JavaScript, which should be in a function. This function should perform a variety of actions depending on the values entered by the user, according to the following criteria below. There must also be a paragraph with an ID attribute used for output from the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10],"class_list":["post-54729","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-writing"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/54729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=54729"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/54729\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=54729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=54729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=54729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}