Unit 1 Programming Assignment
Follow the directions for each of the following questions. Answer the question or provide the code in a space below the question.
1. Write the complete script tag set for a script whose line statement is
document.write(“Hello, world.”);
2. Build a complete HTML document and include the answer to the previous question such that the page executes the script as the page loads. Open the document in your browser to test the results.
3. Add a comment to the script in the previous answer that explains what the script does.
4. Create an HTML document that displays an alert dialog box immediately after the page loads and displays a different alert dialog box when the user clicks a form button.
5. Carefully study the document in Figure 1 on this page. Without entering and loading the document, predict
a. What the page looks like
b. How users interact with the page
c. What the script does.
Then type information as shown in Figure 1 (observe capitalization and punctuation). Do not type a carriage return after the “=” sign in the upperMe function statement; let the line word-wrap as it does in the following listing. It’s ok to use carriage return between attribute name/value pairs, as shown in the first <input> tag. Save the document as an HTML file and load the file into your browser to see how well you did.
6. Which of the following are valid variable declarations or initializations? Explain why each one is or is not valid. If an item is invalid, how do you fix it so that it is valid?
a. My_name = “Cindy”;
b. Var how many = 25;
c. Var zipcode = document.getElementById(“zip”).value
d. Var 1address = document.(“address1”).value
Figure 1 |
|
<html> <head> <title>Text Object Value</title> <script type=”text/javascript”> // <! function upperMe() { document.getElementById(“output”).value = document.getElementByid(“input”).value.toUpperCase(); } // --> <body> Enter lowercase letters for conversion to uppercase:<br> <form name=”converter”> <input type=”text” name=”input” id=”input” value=”sample” onchange=”upperMe()” /><br /> <input type=”text” name=”output” id=”output” value=”” /> </form> </body> </html> |
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
Unit 1 Programming Assignment Follow the directions for each of the following questions. Answer the question...
<!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 8 Hands-on Project 8-1 Author: Date: Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>Hands-on Project 8-1</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.65897.js"></script> </head> <body> <header> <h1> Hands-on Project 8-1 </h1> </header> <article> <h2>New Account Information</h2> <form> <fieldset id="deliveryinfo"> <label for="fnameinput">First Name</label> <input type="text" id="fnameinput" name="fname" /> <label for="lnameinput">Last Name</label> <input type="text" id="lnameinput" name="lname" /> <label for="addrinput">Street Address</label> <input type="text" id="addrinput" name="address" /> <label for="cityinput">City</label> <input type="text" id="cityinput" name="city"...
in the following java script code follow the instructions provided <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 5 Hands-on Project 5-2 Author: Date: Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Hands-on Project 5-2</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 5-2 </h1> </header> <article> <h2>Change of address form</h2> <form> <fieldset id="contactinfo"> <label for="addrinput"> Street Address </label> <input type="text" id="addrinput" name="Address" /> <label for="cityinput"> City </label> <input type="text" id="cityinput" name="City"...
Modify the following file, so that: If the user input for the age input box is empty, please send the user a warning message: “Age field cannot be empty” and return to the form web page to allow the user to re-input the age; If the user input for the age input box is incorrect (e. g. less than 1), please also send the user a warning message: “Your age input is not correct!” and return to the form web...
Create an HTML5 page that contains a form to collect the following data. The text in bold indicates the id value that should be assigned to each html control: Product (drop down list) product – iPad, iPhone 6S, Galaxy 5S, Moto X, and so on Quantity (number) quantity Unit price (number) unit_price Discount (%)(number) discount_rate Date (date) order_date First Name (text box) first_name Last Name (text box) last_name Payment type (drop down list) payment_type – Visa, Master, Discover, Amex, and...
I have some code for HTML/Javascript but I need to change it up a bit. Heres the assignment and what I have. The part in the bold is what I need help with. I need a button called new timer for when it reaches zero... Thank you. Assignment For this assignment, you will write a timer application in HTML and JavaScript. Your HTML document should contain the following elements/features: HTML tags: An <input> tag labeled "Timer Duration" with the initial...
<html> <head> <title>Sign Up page</title> <form name="validationForm" method="post" onsubmit="return checkvalidation()"> <!--div class--> <div class="formvalidation"> <label>Your first Name</label> <span id="showname"></span> <!--label for firstname--> <input type="text" name="firstname" class="formsignup" id ="firstn" placeholder="Enter your Name"> <br><br> <!--lastname--> <label>Your last Name</label> <span id="showlname"></span> <input type="text" name="lastname" class="formsignup" id="lastn" placeholder="Enter your last Name"> <br><br> <!--email--> <label>Your Email</label> <span id="showemail"></span> <input type="email" name="emailid" class="formsignup" size="45" id="emailn" placeholder="Enter your Email"> <br><br> <input type="submit" value="send"> </div> </form> <script> function checkvalidation(){ var name = document.forms["validationForm"]["firstname"].value; var lname...
NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...
How can I connect the html forms to php --> mysql database <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <h2> <center> Average: </h2> <h3> <center> Rate the following: </h2> <h3> <center> Rating Criteria: <br> Developing (0-5), Competent (6-10), Accomplished (10-15); </h3> <center> Judge Name: <input type="text" id="judge"> <br> <br> <center> 1. Articulate requirements and design of the project: <input type="text" id="num1"> <br> <br> 2. Plan the solution and implement the project: <input type="text" id="num2"> <br> <br> 3....
Modify this code to store the form elements as variables and display them on the page in an HTML table. <!DOCTYPE html> <html> <head> <script> function getValues() { var result = ""; result += "First Name: " + document.forms["myForm"]["fname"].value + "<br>"; result += "Last Name: " + document.forms["myForm"]["lname"].value + "<br>"; result += "Address: " + document.forms["myForm"]["address"].value + "<br>"; result += "City: " + document.forms["myForm"]["city"].value + "<br>"; result += "State: " + document.forms["myForm"]["state"].value + "<br>"; document.getElementById("output").innerHTML = result; } </script>...
<!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 4 Hands-on Project 4-3 Author: Date: Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Hands-on Project 4-3</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 4-3 </h1> </header> <article> <div id="results"> <p id="resultsExpl"></p> <ul> <li id="item1"></li> <li id="item2"></li> <li id="item3"></li> <li id="item4"></li> <li id="item5"></li> </ul> </div> <form> <fieldset> <label for="placeBox" id="placeLabel"> Type the name of a place, then click Submit: </label> <input type="text" id="placeBox"...