post() to variable URL
post() to variable URL
I am a newbie to JQuery. I have managed to get a lot of what I want working but this one has me stumped so any help would be appreciated.
In my Symfony project I have a form that loads a new data table into a div based on a url (actually the route to a symfony partial/action) with the parameters for the query serialized() with the post. Now I want to be able to change the same area to display graphs so I need to post the same information but to a different url.
My script looks like;
- $(document).ready(function(){
$("form#datadayform").submit(function() {
$.post('station/dataday',
$("#datadayform").serialize(), function(data) {
$('#partial').html(data);
});
return false;
});
});
but how can I set the url (at the moment set to 'station/dataday') using a variable from the form such as radio buttons?