that's my function:
<script> function Calculate() { var ItemPrice = document.getElementById("price"); var weight = document.getElementById("weight"); var SelWeight = weight.options[weight.selectedIndex].value; alert(SelWeight); var Category = document.getElementById("SelectedCategory"); var SelCategory = Category.options[Category.selectedIndex].value; alert(SelCategory); } </script> i want to get SelCategories.Tax and SelCategories.Duty to add them to weight value and total price to show the total in a label.. I'm using ASP.NET MVC 4 and this is my Model that i want to use
public class CategoriesModel { public int CategoryID { get; set; } public string CategoryName { get; set; } public decimal Duty { get; set; } public decimal Tax { get; set; } public IEnumerable<SelectListItem> CategoriesList { get; set; } }
controllerand anaction methodwhich will serve the data that you want in the client. And you may make an ajax call to retrieve the data from the controller action.<select>tag how will i pass the selected value to controller??<select>and the second 2- is using this model @MattBodily