/    Sign up×
Community /Pin to ProfileBookmark

need help with code below

Hi i cannot get this code to work what i want to do is select 1 option and send it from index.html to page2.html using js.
how can i send it to page2.html? can anyone do a small working demo with source code sending selected option to page 2
here is code u can use i been struggling to get it to work

[code]
<h1>Photos</h1>
<form action=”./html/page2.html”>
<select id=”mytext”>
<option disabled>Photos</option>
<option>8×10 $25</option>
<option>5×7 $10</option>
<option disabled>Giftcards</option>
<option>6×4 $4</option>
<option>5×7 $5</option>
</select>
<input type=”submit” value=”submit” onclick=”passval()”>
</form>
[/code]

please help me.

to post a comment
Full-stack DeveloperHTMLJavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 11.2019 — What does the passval() function do? Does it return true on success?
Copy linkTweet thisAlerts:
@HarshShahDec 13.2019 — Hi

You can use browsers local storage for it.

I have created a Demo in which you can get value of Drop-down and pass it to another html page.

For that we can use local storage to save selected value of Drop down. Then we can use that value to the another page.

In this demo i have made to pages. In one page when we select value of drop-down and hit submit button, it stores that value in browsers local storage. then it redirect to another html page and display that value from local storage.

Find it from here: https://github.com/HarshShah-ifour/JsDemos.git

let me know if have any query. Hope it will help you.

Thank you.
Copy linkTweet thisAlerts:
@SempervivumDec 13.2019 — @HarshShah#1611779

The TO tried this already, look here:

https://www.webdeveloper.com/d/387000-select-8x10-not-showing-up/10

@Bigjohn7769 Please don't open multiple posts for the same subject, continue at the thread linked above.
Copy linkTweet thisAlerts:
@SempervivumDec 13.2019 — {"locked":true}
×

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 4.23,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...