|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
khurram_01 Smarty n00b
Joined: 11 Mar 2012 Posts: 1
|
Posted: Sun Mar 11, 2012 11:19 pm Post subject: html_quickform textfield value automatic update in smarty |
|
|
I html_quickform element 'text' in php and assigning to smarty template... In smarty template I want to change this this text value {$link_doc_create.parent_doc.html} automatically with event... i.e. user click on list that trigger javascript function and within this function ... text field value chage automatically...
here is my code...
------------smarty----------
<div id="doc_link_section">
{$link_doc_create.javascript}
<form {$link_doc_create.attributes}>
{$link_doc_create.hidden}
<div id="parent_doc_block">
{$link_doc_create.parent_doc.label}:
{$link_doc_create.parent_doc.html}
</div>
<div id="child_link_doc_block">
{$link_doc_create.Child_Doc.label}:
{$link_doc_create.Child_Doc.html}
</div>
<div id="doc_link_operation_bar">
{$link_doc_create.submit.html}
</div>
</form>
</div>
------------php---------------
$form_ld_2 = new HTML_QuickForm("search_by_material", "post", $_SERVER['REQUEST_URI'], "", null, true);
$form_ld_2 -> addElement('text', 'parent_doc', "Parent Document ", 'class = "inputText"');
$form_ld_2->addElement('textarea', 'Child_Doc', 'Child Document', 'class = "inputText"');
$form_ld_2 -> addElement('submit', 'submit', 'Create Relation', 'class = "flatButton"');
if($form_ld_2->isSubmitted() && $form_ld_2->validate())
{
print_r("form_ld2 enter");
$values = $form_ld_2 -> exportValues('parent_doc');
$given_parent_doc = $values['parent_doc'];
$values = $form_ld_2 -> exportValues('Child_Doc');
$given_child_doc = $values['Child_Doc'];
print_r(" count given_parent_doc ". count($given_parent_doc));
print_r(" given_parent_doc ".$given_parent_doc);
}
$renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty);
$form_ld_2->accept($renderer);
$smarty->assign('link_doc_create', $renderer->toArray()); |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|