Skip to content

Commit

Permalink
Adding an option named 'ids', containing an array of input ids.
Browse files Browse the repository at this point in the history
The values of these input will be passed into the ajax request.
  • Loading branch information
sterrien committed Mar 16, 2012
1 parent d9a4e2a commit b750c65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Resources/doc/jquery/autocomplete/choices_ajax.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ public function buildForm(FormBuilder $builder, array $options)
$builder
->add('ajax_simple', 'genemu_jqueryautocompleter', array(
'route_name' => 'ajax'
'ids' => array('id_1', 'id_2'),
))
->add('ajax_multiple', 'genemu_jqueryautocompleter', array(
'route_name' => 'ajax',
'multiple' => true
'multiple' => true,
'ids' => array('id_text', 'id_select'),
));
}
```
Expand All @@ -36,6 +38,8 @@ class MyClassAjaxController extends Controller
public function ajaxAction(Request $request)
{
$value = $request->get('term');
$id_text = $request->get('id_text'); // The value of text will be passed in the ajax request
$id_select = $request->get('id_select'); // The value of select will be passed in the ajax request

// .... (Search values)
$search = array(
Expand Down

0 comments on commit b750c65

Please sign in to comment.