|
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 |
vmegag Smarty n00b
Joined: 07 Mar 2007 Posts: 3
|
Posted: Mon Mar 26, 2007 10:04 am Post subject: Formcat (client-side validation) cannot find posted data |
|
|
Hey guys,
Very good job u did here...
Using smarty since not so long but happy with it.
Since weeks i'm using Formcat 1.04 from Joey. But I'm getting problems to access to my posted data from any form validated with Formcat... This make my crazy.
Here is a part of my php: test_post.php
Code: |
// CHECK PARAMETERS POSTED --------------------------------------------------------------------
if (isset($_POST['btnLogin'])) {
$bouton = $_POST['btnLogin'];
if(!empty($bouton)) {
// ----- Manage Login try -------
echo 'LOGIN: ' . $bouton;
exit();
}
}
|
I'm doing that in that way because I need many forms on a page.
Here is one of my forms tpl:
Quote: |
{catform FORM="frmLogin" flashFocus="TRUE" submitOnce="TRUE"}
<form name=frmLogin id=frmLogin action="test_post.php" method="post">
<p>
<div style="background-color:#2D0C1D; font-weight:bold; color:#FFFFFF; height:26px; padding-top:5px; padding-bottom:5px"> Votre compte</div>
<p>
<div style="padding-left:20px">
<table width="760" border="0">
<tr>
<td width="160">Pseudo <span class="formMandatory">*</span></td>
<td width="250"><input type="text" name="Login" size="25" maxlength="20" /></td>
<td></td>
{formcat check="notEmpty" field="Login" message="vous devez saisir votre pseudo" focus="true"}
</tr>
<tr>
<td>Password <span class="formMandatory">*</span></td>
<td><input type="password" name="Password" size="25" maxlength="20" /></td>
<td><input name="btnLogin" type="submit" value="Connecter" /> </td>
{formcat check="notEmpty" field="Password" message="vous devez saisir votre mot de passe" focus="true"}
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</form>
{/catform}
|
1-> when I'm activating validation inside main form => Nothing append test_post.php do not see my pressed button (variable) !!
2-> when commenting validation from main form like that:
Code: |
//$fc = new formcat;
//$smarty->register_outputfilter(array(&$fc,'fcOutputFilter'));
|
-> test_post.php is able to handle posted data !!
What's going on
Do I made mistakes
Many thanks to all of U.
Vincent. |
|
Back to top |
|
vmegag Smarty n00b
Joined: 07 Mar 2007 Posts: 3
|
Posted: Sat Mar 31, 2007 8:32 am Post subject: |
|
|
OK, guys...
Here is the explanation (simple):
Since i'm using the functionality submitOnce="TRUE"} -> the submit button that i'm trying to get when form is posted, is basically desactivated then NOT TRANSMITTED when POSTED !!
Sounds like a nooby mistake.
Anyway the alternative is to use hidden fields, since they are transmitted correctly via a post
Thanks anyway.
Vincent. |
|
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
|