Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

[Help] Filter Form

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
alissonpc
Smarty n00b


Joined: 02 Jul 2014
Posts: 3

PostPosted: Wed Jul 02, 2014 4:40 pm    Post subject: [Help] Filter Form Reply with quote

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
View user's profile Send private message
alissonpc
Smarty n00b


Joined: 02 Jul 2014
Posts: 3

PostPosted: Wed Jul 02, 2014 4:45 pm    Post subject: Reply with quote

if helps..
I'm trying to that on Testlink project
Back to top
View user's profile Send private message
alissonpc
Smarty n00b


Joined: 02 Jul 2014
Posts: 3

PostPosted: Thu Jul 03, 2014 11:58 am    Post subject: Reply with quote

GOT IT!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP