Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
Bella 10.08.2005 14:17
Но в $asw_id - пусто<form method="post" action="anketa.html?work_id=$form:edit_id" enctype="multipart/form-data"> ^dbc{ $answers[^table::sql{select id_question, text, comment from anketa_question}] $answ[^table::sql{select id_answer, woker_id, question_id, answer_text from anketa_answer where woker_id = '$form:edit_id' }] <table cellspacing="1" cellpadding="3"> ^answ.menu{ <tr> <td width="30%" align="RIGHT" valign="MIDDLE"> ^if(^answers.locate[id_question;$answ.question_id]){ $answers.text } </td> <td><input type="Text" name="asw_$answ.question_id" size="45" value="$answ.answer_text"></td> <td> ^if(^answers.locate[id_question;$answ.question_id]){ <i>$answers.comment</i> } </td> </tr> } <tr> <td colspan="3" align="CENTER"><br /><input type="submit" value=" Отправить " name="posted"><br /></td> </tr> </table> ^form:fields.foreach[field;value]{ ^if(^field.match[asw_[0-9]+][]){ $asw_id[^field.match[asw_([0-9]+)][]{$match.1}] ^void:sql{ UPDATE anketa_answer SET answer_text = '$form:[asw_$asw_id]' WHERE woker_id = '$form:edit_id' and question_id = $asw_id } } } }