I'm using jquery for form submission. For the form I'm using the following html:
<form class="classform form-horizontal" id="id_name">
...
<button class="btn btn-success" type="button" id="buts_button">Save</button>
</form>.
in jquery I'm doing this:
$(document).ready(function ()
{
$("#buts_button").click(function ()
{
var data = $( "#id_name" ).val();
var url = "name.php?Agt="+data+"
$.post(url,function (data){
alert("Saved Successfully");
location.reload();
});
});
If I click the button it is not showing the alert like "Saved Successfully". the value is coming in URL why?. in I'm not using the Get method also. can u help me?
Working jquery in same page
$(document).ready(function ()
{
$("#age_edit_btn").click(function (){
var vst_id = $( "#vst_admin_id" ).val();
var age_name = $( "#age_name" ).val();
var agen_hall = $( "#age_hall" ).val();
var url = "eve_home_controller.php?Age_edit="+vst_id+"&age_name="+age_name+"&age_hall="+age_hall);
$.post(url,function (data){
alert("Updated Successfully");
});
});
});
Not working jquery in same page.
$(document).ready(function (){
$("#spe_save").click(function (){
var spe_data = "Spk_Rdy";
var rate_eve_id = $( "#rate_eve_id" ).val();
if(rate_event_id == "")
{
alert('Please select the event id');
$( "#rate_event_id" ).focus();
return false;
}
var rate_age_id = $( "#rate_age_id" ).val();
var spe_title = $("#spe_title").val();
var spe_name = $("#spe_name").val();
var spe_details = $("#spe_details").val();
var url = "event_home_controller.php?Spk_Rdy="+spe_data+"&rate_eve_id="+rate_eve_id+"&rate_age_id="+rate_age_id+"&spe_title="+spe_title+"&spe_name="+spe_name+"&spe_details="+spe_details;
$.post(url,function (data){
alert(data);
alert("Saved Successfully");
location.reload();
});
});
});