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

In Refresh , the erro messengers show... (?)

 
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 -> Add-ons
View previous topic :: View next topic  
Author Message
diogoweb
Smarty Rookie


Joined: 15 Apr 2005
Posts: 6
Location: Brasil

PostPosted: Sat Apr 16, 2005 4:02 am    Post subject: In Refresh , the erro messengers show... (?) Reply with quote

When the form is generated for the first time, ok. When the user click REFRESH, the messages of errors appear before submit.

Why?


[php:1:921061a6b7]<?php
validator.php

<?PHP session_start();
require('libs/smarty/Smarty.class.php');
require('libs/smarty/SmartyValidate.class.php');

$smarty =& new Smarty;

// required initialization

SmartyValidate::connect($smarty,true);
if(empty($_GET)) {

$smarty->display('form.tpl');
} else {
// validate after a POST
if(SmartyValidate::is_valid($_GET)) {

// no errors, done with SmartyValidate
SmartyValidate::disconnect();
$smarty->display('success.tpl');
} else {
// error, redraw the form

$smarty->assign($_GET);
$smarty->display('form.tpl');
}
}

?>

form.tpl


<form method="GET" action="validator.php">


Full Name: <input type="text" name="FullName">
{validate field="FullName" criteria="notEmpty" message="Full Name cannot be empty"}
<p>
Date: <input type="text" name="test">
{validate field="test" criteria="notEmpty" message="Full Name cannot be empty"}
<input type="submit">
</form>

?>[/php:1:921061a6b7]

tnks...
_________________
"Abre seus braços meu irmão , deixa cair... Pra que somar se agente pode dividir..."
Back to top
View user's profile Send private message Visit poster's website
migas
Smarty Regular


Joined: 07 Apr 2004
Posts: 73
Location: Porto, Portugal

PostPosted: Sat Apr 16, 2005 6:31 pm    Post subject: Reply with quote

Try using the form with the metoth POST because normaly your PHP's has some values in the $_GET.

Type in your script phpinfo(32);
#32 will only show you the system Var's.

Boas Linhas Smile
Back to top
View user's profile Send private message
diogoweb
Smarty Rookie


Joined: 15 Apr 2005
Posts: 6
Location: Brasil

PostPosted: Sat Apr 16, 2005 10:32 pm    Post subject: Reply with quote

migas wrote:
Try using the form with the metoth POST because normaly your PHP's has some values in the $_GET.

Type in your script phpinfo(32);
#32 will only show you the system Var's.

Boas Linhas Smile


I tried, but the error continues. (with post,get, or a control variable in hidden)
Confused
_________________
"Abre seus braços meu irmão , deixa cair... Pra que somar se agente pode dividir..."
Back to top
View user's profile Send private message Visit poster's website
migas
Smarty Regular


Joined: 07 Apr 2004
Posts: 73
Location: Porto, Portugal

PostPosted: Sun Apr 17, 2005 7:36 pm    Post subject: Reply with quote

Post the error here
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 -> Add-ons 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