I have a form that uses a JQuery Json post. I have 10+ textboxes on the page. I have variables passed the only way I know... is there another way to pass multiple variables?
$('#nameSubmit').click(function() {
var status = document.getElementById('Select2').value;
var lob = document.getElementById('LOB').value;
var lName = document.getElementById('LName').value;
var fName = document.getElementById('FName').value;
var city = document.getElementById('City').value;
var state = document.getElementById('State').value;
$.post("Home/LoadTable", { Status: status, LOB: lob, LName: lName, FName: fName, City: city, State: state }, function(data) {
//...process code works
}, 'json');
});
EDIT
I am using the following method to add textbox and dropdown lists...
<%using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "myForm" })) {%>
<td><%= Html.TextBox("LName")%></td>
<select name="Status" id="Select2">
<option value="ALL">All Policies</option>
<option value="Active">Active</option>
<option value="Cancelled">Cancelled</option>
</select>
<% } %>