Buy Now
Sign in

Autocompleter

fiatlux , November 03 2016, 22:04
F
fiatlux 2
November 03 2016, 22:04 #362831
I used the code for country from the example to create a new text field called Wings. I've not found documentation that explains where the field selector value or the AJAX form event is taken from for the country example? The code does not work.
<?php
$wings = array(“1st Fighter Wing”, “1st Special Operations Wing”,
“2d Bomb Wing”, “3d Wing”, “4th Fighter Wing”, “5th Bomb Wing”,
“6th Air Mobility Wing”, “7th Bomb Wing”, “8th Fighter Wing”);
foreach($wings as $wing){
  if(!empty($form->data['tag'
  • ) AND stripos($wing, $form->data['tag']) === false){
        continue;
      }
      $json
  • = array('id' => $wing, 'text' => $wing);
    }
    echo json_encode($json);
    Attachments
    Screen Shot 2016-11-03 at 6.02.46 PM.png
    Screen Shot 2016-11-03 at 6.02.46 PM.png
    (16.41 KiB)
    250 Downloads/Views
    admin 28
    November 11 2016, 06:31 #362982
    Hi fiatlux,

    The field selector can be this:
    #FIELD_ID_HERE


    And the AJAX form even is the name of the event which holds the custom code action in the form, its the last one under "Setup", its called "countries_list" at the demo form.

    I think using the code you have without any other changes to the form setup should get it to work.

    Best regards,
    Max
    Max
    If your main question got answered then please mark the answer using the button!
    Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!