This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

php action links passing javascript (jquery) generated variables

Other symfony projects

php action links passing javascript (jquery) generated variables

by tatanajllo » Tue Jul 15, 2008 6:10 pm

Hi I really need your expertise on this.

I'm trying to link to an action but before going to the action I need to get the variables from a javascript.

To better explain:

in my module success:

<div class = 'navigation_select'><a onClick="createadNzone()" href="#">Create</a></div>

in my .js file:

function createadNzone()
{
var load_week = $("#navigation_week").selectedValues();

$.ajax({
type: "POST",
URL: "/navigation/addadNzones",
data: "load_week="+load_week+""
});

}

in my action:

public function executeAddadNzones($request)
{

$newAdhere = new Ad();
$newAdhere->setLoadWeek($request->getParameter('load_week'));
$newAdhere->save();

$this->redirect('zone/edit?ad_key='.$newAdhere->getAdKey());
}


Nothing is happening here the ajax does post the values, but it does not redirect to the action... it stays the current page loaded.

Pls help.
tatanajllo
Junior Member
 
Posts: 13
Joined: Wed Jul 09, 2008 2:05 pm