/    Sign up×
Community /Pin to ProfileBookmark

not receiving data on page 2

Not getting anything on page2 after i select option from index.html etc how can i fix it?

[code]
index.html code
<!DOCTYPE html>
<html>
<head>
<title> Page 2 – Codemaker</title>
<script>
function passval()
{
var selecttext=document.getElementById(“mytext”).value;
localStorage.setItem(“ddvalue”,selecttext);
return true;
}
</script>
</head>
<body>
<h1>Photos</h1>
<form action=”./html/page2.html”>
<select id=”mytext”>
<option selected disabled>Photos</option>
<option>8×10 $25</option>
<option>5×7 $10</option>
<option selected disabled>Giftcards</option>
<option>6×4 $4</option>
<option>5×7 $5</option>
</select>
<input type=”submit” value=”submit” onclick=”passval()”>
</form>
</body>
</html>
[/code]

[code]
page2,html

<!DOCTYPE html>
<html>
<head>
<title>Page 2</title>
</head>
<body>

you selected:<span id=”results”></span>

<script>
document.getElementById(“results”).innerHTML=localStorage.getItem(“ddvalue”);
</script>
</body>
</html>
[/code]

to post a comment
Java

4 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumDec 10.2019 — I created two test files containing your code and it's working fine. Maybe the error is located somewhere else?
Copy linkTweet thisAlerts:
@VITSUSADec 10.2019 — @Bigjohn7769#1611635 This code is working, please try again.
Copy linkTweet thisAlerts:
@Bigjohn7769authorDec 10.2019 — when i select 8x10 option nothing appears in Firefox only you selected [upl-image-preview url=https://www.webdeveloper.com/assets/files/2019-12-10/1575972585-482704-screenshot-741.png]
Copy linkTweet thisAlerts:
@NogDogDec 10.2019 — Don't know if it's the problem, but the HTML is poorly formed. ("You selected" is not within a text element tag.)

Do you see anything "interesting" if you do a "view source" of the output in the browser?
×

Success!

Help @Bigjohn7769 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.10,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...