Задача – после сабмита формы, если есь ошибки заполнения с помощью ajax_update вписываем описания ошибок над элементами формы.
Если ошибок нет, на месте формы пишем “Success”
1 | {ajax_form method="post" id="form_register" params="opt=save"} |
php-файл
1 2 3 4 | if (!isset($_REQUEST['opt'])) {$opt = 'view';} else {$opt = $_REQUEST['opt'];} |
у меня не передается параметр в php файл
пробывал и $_REQUEST, $_POST, $_GET
I’m trying to use ajax_form with the callback to change to nextpage.php if the form is OK.
The callback is called, but allways, also if the form is NOT good.
I did not understand the solution you gave to David, since that is from the chat example.
Can you help ?
I have:
1 2 3 4 5 6 7 8 | function finishfunc() { document.form_register.action = "nextpage.php"; document.form_register.submit(); return false; // Is this required?? } var finishcallback = finishfunc; |
and
1 2 3 | {ajax_form method="post" id="form_register" callback='finishcallback'} ... {/ajax_form} |
Thanks, Alexander
]]>