1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kotykmax [81]
3 years ago
5

Create and integrate a script on the registration.html page that stores the input field data into hidden fields to be used in th

e interests.html page once the submit button is pressed. Create an interests.html page with a form that has the fields listed above. This interests.html page will read in the input from the query string data from the registration.html page and store them into hidden input fields. Write a script that runs in response to the submit event, from the interests.html page, that saves the input from both pages to a series of cookies to store each input, and opens a third page called confirm.html that reads and displays information from all the fields.
Computers and Technology
1 answer:
Pavel [41]3 years ago
3 0

Answer:

Explanation:

// CAPTURE QUERY STRING VALUES

var urlParams = new URLSearchParams(location.search);

var uid = urlParams.get('userName');

var fName = urlParams.get('firstName');

var lName = urlParams.get('lastName');

var pass = urlParams.get('password');

var email = urlParams.get('email');

var phone = urlParams.get('phoneNumber');

var signUp = urlParams.get('signUpNewsletter');

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

Modified the checkbox control into multiple control

<div>

<select id="interests" name="interests" multiple>

<option value="Technology">Technology</option>

<option value="Music">Music</option>

<option value="Movies">Movies</option>

</select>

</div>

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

Added a js function to read multiple input values

function getSelectValues(select) {

var result = [];

var options = select && select.options;

var opt;

for (var i=0, iLen=options.length; i<iLen; i++) {

opt = options[i];

if (opt.selected) {

result.push(opt.value || opt.text);

}

}

return result;

}

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

Below is how I create cookie object

ar data =

{

uid:document.myForm.userName.value,

fName: document.myForm.firstName.value,

lName: document.myForm.lastName.value,

pass: document.myForm.password.value,

email: document.myForm.email.value,

phone:document.myForm.phoneNumber.value,

signUp: document.myForm.signUpNewsletter.value,

interests: getSelectValues(document.myForm.interests).toString(),

comment: document.myForm.comment.value,

referredBy: document.myForm.referredBy.value,

};

var dataString = "uid=" + data.uid + ",fName=" + data.fName + ",lName=" + data.lName + ",pass=" + data.pass + ""+ +",email=" + data.email + ",phone=" + data.phone + ",signUp=" + data.signUp + ",interests=" + data.interests + "" + +",comment=" + data.comment + ",referredBy=" + data.referredBy + "";

===========

Make sure you write last line in single line

You might be interested in
Which are characteristics of interpreters? Select
SVEN [57.7K]

Answer:

translation is used for interpretation

8 0
3 years ago
Read 2 more answers
What I'd the keyboard shortcut for applying bold font to a text selection ​
garik1379 [7]

It is the second option

3 0
3 years ago
Makes it possible to distribute both power and data using ethernet cabling. select one:
Nimfa-mama [501]
It would be: 

b.) poe cable 

message me on my profile if you need any more help! :) 
6 0
3 years ago
Gas giants have rings and satellites.
user100 [1]
Gas giants DO have rings and satellites.
It's true.
6 0
3 years ago
Read 2 more answers
Do most good businesses have to deal with conflict
NeX [460]

Answer: Yes.

Explanation: Most good businesses have to deal with conflict, whether it be law suits, unhappy customers, even occasional bad reviews could be considered conflict. although better businesses usually have less conflict than bad businesses

6 0
3 years ago
Other questions:
  • A customer service representative for an Internet provider uses various techniques to help a frustrated customer with a slow Int
    13·1 answer
  • What Software is used to play,create, and modify audio and video files
    7·2 answers
  • Cloud computing service providers manage different computing resources based on the services they offer. Which resources do IaaS
    11·1 answer
  • Does a soda vending machine Give reciepts?<br><br>need for computer science hw
    7·2 answers
  • A professional bureaucracy is a knowledge-based organization where goods and services depend on the expertise and knowledge of p
    7·1 answer
  • A ___describes a particular attribute of the dates item in a table​
    14·1 answer
  • Edhesive code practice 4.8 Question 3
    5·2 answers
  • Write code which takes two inputs from the user, a number of sides followed by a side length, then creates a regular polygon wit
    10·2 answers
  • Answer any one: write a computer program:which you know.​
    6·1 answer
  • Different the policies and protocols in the industry
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!