Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd multiple element with jQuery using symfony 1.4
    primarykey
    data
    text
    <p>I am going to be as clear as I can be, but don't hesitate to tell me if there is something you don't understand.</p> <p>What I'm trying to do shouldn't be complicated, I've read tons of stuff about it, but I'm looking for some tips to get me started...</p> <p>Okay, So I have two tables, "Utilisateur" and "Contact"</p> <p>What I'd like to do, is, when adding a new contact, I'd like to have a list of all the Utilisateurs on the left, and with a doublelist widget, when adding one or many utilisateusr to the right column, it adds the utilisateur(s) to my contact list.</p> <p>In other words, when an utilisateur is selected and transfered in the right column of my double list, it creates a new contact for each utilisateur selected.</p> <p>Am i clear ?</p> <p>I have written already the javascript code for my double list, but i'd like to have some help on the action handling.... How, in my action can I tell Symfony to add a new contact for each utilisateur selected ?</p> <p>I may add that a contact has an "utilisateur_id" field, so I just need to match the "utilisateur_id" of the contact with the id of the utilisateur object each time an utilisateur is selected and transfered....</p> <p>Ohlala, am I clear ? :)</p> <p>Anyways, thank you for reading this post til the end, and hep much be, as usual, much appreciated !</p> <p>EDIT</p> <p>So i've created a new button "mybutton"</p> <p>add this js code:</p> <pre><code>$('#mybutton').click(function(){ alert( "Bouton"); var value = $("#contact_utilisateur_id").val(); $.post("http://localhost:8080/backend_dev.php/en/contact/add", {myParam : value}, function(data) { alert( "Data saved: " + value); } ); }); </code></pre> <p>then, I created an action "add":</p> <pre><code>public function executeAdd(sfWebRequest $request){ if($request-&gt;isXmlHttpRequest()){ $this-&gt;redirect('@contact'); } </code></pre> <p>But it seems that executeAdd is never read....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload