Question

In: Computer Science

Problem Description Write a web page that allows a person to enter address information, salutation, and...

Problem Description Write a web page that allows a person to enter address information, salutation, and a prize amount. Place a button at the bottom of the page that, which clicked, displays the contents of a letter informing them that they've won

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new web page with name "won.html" is created, which contains following code.

won.html :

<!DOCTYPE html>

<html lang="en">

<head>

<!-- title for web page -->

<title>Letter Details</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

</head>

<body>

<!-- dropdown list for salutation -->

<select id="salutation">

<option value="selected" selected>--Select Salutation--</option>

<option value="Mr">Mr.</option>

<option value="Mrs">Mrs</option>

</select>

<!-- textbox for name -->

<input type="text" id="txtName" placeholder="Enter Name">

<br><br>

<!-- textarea for address -->

<textarea name="address" id="address" cols="20" rows="5" placeholder="Enter Address"></textarea>

<br><br>

<!-- textbox for price -->

<input type="text" id="txtPrice" placeholder="Enter price amount"/>

<br><br>

<!-- button to submit form -->

<input type="button" value="Submit" onclick="getletterDetails()">

<br><br>

<!-- div to display details -->

<div id="letter"></div>

<!-- <script> is used for javascript -->

<script>

//function to get details

function getletterDetails()

{

//get salutation

var salutation=document.getElementById("salutation").value;

//get name

var name=document.getElementById("txtName").value;

//get address

var address=document.getElementById("address").value;

//get price

var price=document.getElementById("txtPrice").value;

//print details in the label

var htmlString="";

htmlString+="Welcome "+salutation+" "+name+" you have won price of "+price;

htmlString+="<br/> Amount will be sent on the below address<br/>";

htmlString+="<address>"+address+"</address>";

//display details on the label

document.getElementById("letter").innerHTML=htmlString;

}

</script>

</body>

</html>

======================================================

Output : Compile and Run won.html to get the screen as shown below

Screen 1 :won.html

Screen 2:When details are entered , will get the screen as shown below

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

Need to HAVE a web page that uses a loop to allow a teacher to enter...
Need to HAVE a web page that uses a loop to allow a teacher to enter the following information for all students in a class: student's name, mt  grade, f  grade, hW grade, attendance grade. program should calculate each student's numeric total grade based on the following formula:course grade = (mT*0.3)+(f*0.4)+(homework*0.2)+(attendance*0.1)File Table.html looks like this:When the button is clicked, you need to prompt the user the following information:-number of students (which will determine the number of rows in your table)-student's name-mT grade-f...
You are designing a web page that allows users to create an event listing. The event...
You are designing a web page that allows users to create an event listing. The event listing should include the date, time, location, title, phone, email, coordinator, and description of the event. The location should be between 10 and 100 characters long. The title should be between 1 and 50 characters long. The description should be between 10 and 200 characters long. Phone number consists of numbers and dashes. Email has to have an @ symbol. All data elements should...
Create a web page using PHP that allows the users to create an account (a username...
Create a web page using PHP that allows the users to create an account (a username and a password). There should be a login page that allows users to create an account by entering their preferred username and password. The same page should also let users login if they already have an account. If a user is logged in successfully , they should be able to enter a comment and also read the comments entered by others previously.
You are designing a web page that allows users to create an event listing. The event...
You are designing a web page that allows users to create an event listing. The event listing should include the date, time, location, title, phone, email, coordinator, and description of the event. The location should be between 10 and 100 characters long. The title should be between 1 and 50 characters long. The description should be between 10 and 200 characters long. Phone number consists of numbers and dashes. Email has to have an @ symbol. All data elements should...
Write a program that runs on SPIM that allows the user to enter the number of...
Write a program that runs on SPIM that allows the user to enter the number of hours, minutes and seconds and then prints out the total time in seconds. Name the source code file “seconds.asm
Write a program that runs on SPIM that allows the user to enter the number of...
Write a program that runs on SPIM that allows the user to enter the number of hours, minutes and seconds and then prints out the total time in seconds. Name the source code file “seconds.asm Explain step by step
Write out code for a nested if statement that allows a user to enter in a...
Write out code for a nested if statement that allows a user to enter in a product name, store the product into a variable called product name and checks to see if that product exists in your nested if statement. You must include 5 product names to search for. If it is then assign the price of the item to a variable called amount and then print the product name and the cost of the product to the console. If...
Write an application that allows a user to enter the names and birthdates of up to...
Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names...
Please write the code JAVA Write a program that allows the user to enter the last...
Please write the code JAVA Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. A sample output is: Candidate      Votes Received                                % of Total Votes...
Problem description Write a C++ program that prompts the user to enter two non-negative integers, firstNum...
Problem description Write a C++ program that prompts the user to enter two non-negative integers, firstNum and secondNum. The program then prints all palindromic primes (Links to an external site.) between firstNum and secondNum, inclusive. A palindromic number is a number whose digits are the same forward or backward (e.g., 12321). A palindromic prime is a prime number that is also a palindromic number (e.g., 101). You must implement and use the following functions as prototyped below: /// --------------------------------------------------------------- ///...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT