How to pass vaues using jquery
Hi,I want to pass a value to another page and display value there and load that page using jquery
i tried following code
$('#addr').click(function (e) {
e.preventDefault();
var url = "AddressForm.aspx?stid=" + encodeURIComponent($("#txtstid").val()) + "&clas=" + encodeURIComponent($("#txtclass").val());
// window.location.href = url;
$('#displ').load(url);
});
here i want to display AddressForm.aspx in displ div. and passing 2 texbox values.
i wrote the code for displaying in AddressForm.aspx
as
var queryString = new Array();
if (queryString.length == 0) {
if (window.location.search.split('?').length > 1) {
var params = window.location.search.split('?')[1].split('&');
for (var i = 0; i < params.length; i++) {
var key = params[i].split('=')[0];
var value = decodeURIComponent(params[i].split('=')[1]);
queryString[key] = value;
alert(value);
}
}
}
$('#astudent').val(queryString["stid"]);
$('#aclass').val(queryString["clas"]);
current problem is Addressform.aspx is displaying but no data is displaying in corresponding textboxes.
How to solve this
Regards
Baiju