ฟอร์มข้อมูล
Code
ผลลัพธ์
Code
<?php
require_once('public/generate-form-v2.php');
$form=new Form();
$field['f1']=[
'label'=>'List',
'type'=>'list_table2',
'limit'=>1,
'command'=>"SELECT `changwatcode`, `changwatname` FROM `cchangwat` WHERE changwatname like '%{q}%'",
'value'=>'90',
'next'=>'f2',
];
$field['f2']=[
'label'=>'List',
'type'=>'list_table2',
'limit'=>1,
'command'=>"SELECT `ampurcode`, `ampurname`, `changwatcode` FROM `campur` WHERE changwatcode='{f1}' and ampurname like '%{q}%'",
'value'=>'09',
'next'=>'f3',
];
$field['f3']=[
'label'=>'List',
'type'=>'list_table2',
'limit'=>1,
'command'=>"SELECT `tamboncode`, `tambonname` FROM `ctambon` WHERE changwatcode='{f1}' and ampurcode='{f2}' and tambonname like '%{q}%';",
'value'=>'09',
];
$form->addField($field);
$form->addObject(['type'=>'submit','value'=>'ส่งข้อมูล']);
echo $form->create();