/    Sign up×
Community /Pin to ProfileBookmark

Can I pass the value of a drop-down menu to the server using GET requests

So I am making this for that asks people to select one option from a `<select>` element and I want to store their response in MongoDB. I am using ExpressJs for this and so I need to pass this data through a GET request to the server when the submit button is pressed.
on the server-side ill use the` body-parser` to give me an object, Will this object contain a key-value pair for the select element also like it does for other input elements like textboxes?

to post a comment

1 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumDec 13.2019 — I don't know about ExpressJs or body-parser but when using a form in plain HTML and PHP on the server a select doesn't behave different from any other input element. Therefore I'm fairly shure that it will work with the tools/librarys you are using.
×

Success!

Help @parthpant 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.26,
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,
)...