i'm trying to get the values submitted by my Ajax call in my jsp using the request.getParameter(); but it keeps giving null, This is my $.Ajax
function get(){
var select = document.getElementById("model");
var selectedString = select.options[select.selectedIndex].value;
alert(selectedString);
$.ajax({
type:"POST",
url:"index.jsp",
data:{fram:selectedString},
dataType:"text",
success:function(data){
alert("data loaded: " );
}});
}
this is what triggers the get();
<select id="model" class="form-control" name="From"style="background:#FCDFD5;" onchange="get()">
<%
while(r.next()){
%>
<option><%=r.getString(3)%></option>
<% } %></select>
the alert works but it says null when i try to print out the value in my jsp, This is my request.getParameter();
<% String name=request.getParameter("fram");
out.println(name);
%>
Thanks a lot in advance