|
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 |
alissonpc Smarty n00b
Joined: 02 Jul 2014 Posts: 3
|
Posted: Wed Jul 02, 2014 4:40 pm Post subject: [Help] Filter Form |
|
|
Hello guys.. how u doing?
There's a table with several rows and I want to create a form with a simple text field to filter its content.. a search engine.
My .tpl is calling the .php perfectly, and .php is woking.
The problem is: the "assign" that is done in .php is "reseted" when it ends.
.TPL:
Quote: |
<form name="filter" method="post" action="myPHP.php">
<input type="text" id="txt_filter" name="txt_filter" value="all" />
<input type="submit"/>
</form> |
...
CONDITIONAL FOR FILTERING:
Quote: | {if $user->firstName == $txtf || $r_d == $txtf || $txtf == 'all'} |
.PHP
Quote: | $smarty->assign('txtf', $_POST['txt_filter']); |
I checked if .php was working using:
echo $smarty->get_template_vars('txtf');
and it is!! It really catch what I typed in "text_filter" but despite my "assign".. "txtf" doesnt change its value to what I typed in .tpl.
Do I need to declare this variable ("txtf") in another file maybe??
Or when I click "submit", "txtf" gets its old value ("all") back.
I dont know.
I tryed everthing!!!
Thanks!
[/quote] |
|
Back to top |
|
alissonpc Smarty n00b
Joined: 02 Jul 2014 Posts: 3
|
Posted: Wed Jul 02, 2014 4:45 pm Post subject: |
|
|
if helps..
I'm trying to that on Testlink project |
|
Back to top |
|
alissonpc Smarty n00b
Joined: 02 Jul 2014 Posts: 3
|
Posted: Thu Jul 03, 2014 11:58 am Post subject: |
|
|
GOT IT! |
|
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
|