TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prakash
NA
258
77.6k
Read dropdown value at server side from hidden field
Aug 30 2016 6:24 AM
Hello Experts,
I am using mvc
In create view i have dropdownlist and i read the value of selected text from dropdown and set to the hidden field.
Now i want postback hidden field and read that value to the server
below create view code
@Html.DropDownList("dealerList", null, "---- Select Dealer ----", new { @class = "form-control", @onchange = "getSelectId();" })
<script>
function getSelectIdpro() {
var select = document.getElementById("productList");
var selectedID = select.options[select.selectedIndex].value;
var selectedText = select.options[select.selectedIndex].text;
alert("Id is " + selectedID);
alert("Name is " + selectedText);
$("#hiddenfield").val(selectedID);
};
</script>
please help
Thank You
Reply
Answers (
2
)
Create Web Api without using Entity framework
Hoe to make space between page navigation links