i would like to know if it is possible to call a javascript function before the ajax request will start (to disable form elements or change the text of the button, eg)
]]>1 2 3 4 5 6 7 8 | <SELECT NAME="sel_art" onchange="{ajax_update update_id="get_collections" function="show_collections" url="get_collections.php" params="artist_id=1"}"> {foreach from=$artist item=arti} <OPTION VALUE="{$arti.id}">{$arti.artist_fname}</OPTION> {/foreach} <SELECT NAME="sel_art" id="get_collections"></SELECT> </SELECT> |
:-(
]]>Дмитрий, у меня вопрос. Есть форма калькулятора.
1 | {ajax_form method="post" id="calculator" url="index.php" params="task=calculator&param=$someparam"} |
После submit возвращает на index.php, get параметры не передаются. Если в функции smarty_block_ajax_form убрать action=” – работает, но с перезагрузкой…
Чего не так?
I solved previouse problem.Now I am using ajax_update without function to send params to certain url.I want to send cat_id which is I am getting in section of template page.here is code:
1 2 3 4 5 6 7 8 | {section name=cat loop="$category"} <tr> <td id="category_trid{$category[cat].id}" class="contenttext2">{$category[cat].id} <a href="#" onclick="{ajax_update update_id='productlist_div' params='catid=`$category[cat].id`&page=product_list_ajax'}">{$category[cat].title}</a> </td></tr> {sectionelse} <tr><td>No category..</td></tr> {/section} |
I am not getting catid value but “$category[cat].id”.why?
but it is giving code text in params not its value
I made a function in index.php getting list of products.
I tpl i called ajax-update function to get list of products in a box.It is giving js-error “Object SmartyAjax not found”.What is my mistake?
i found the params isn’t working when using ajax_update.
can’t figure out why.
this code
1 2 3 4 5 | {foreach from=$DB_RESULTS item=row_obj key=news_id } <li> <a href="#" onclick="{ajax_update update_id='intro_content' function='view_news' params='page=news&&news_id='$row_obj->news_id' '}">read news</a> </li> {foreachelse} |
error display
1 | Catchable fatal error: Object of class stdClass could not be converted to string in F:\Website\www\e-job_V2\resources\templates_c\%%3C^3CF^3CFBC54C%%news.tpl.php on line 43 |
$row_obj->news_id isn’t working
regards,
Nattaphon
e.g. in the register.php example
{ajax_form method=”post” id=”myform”=”index.php?}
…
…
…
if $_POST()…
echo???
{/ajax_form}
is it possible in the $_POST {
instead of using the echo to put the value to an array, can we display a smarty template out e.g.
$smarty->display(outputgrid.tpl”
i.e. want to process the form, and then assign smart values, and then give back to a smarty template.
]]>