View Full Version : SmartyValidate filling form values after submission

Chris Hick
08-09-2012, 07:16 AM
So, apparently, the SmartyValidate forums are no longer active so I thought I would see if anyone knows how to fill the form fields after a validation returns false???

Chris Hick
08-12-2012, 11:19 PM
Any one have any luck with this??

08-12-2012, 11:34 PM
I don't know about SmartyValidate, but wouldn't this version of the form template (form.tpl) re-insert the entered values if they fail the validation?

<form method="post" action="index.php">
{validate id="fullname" message="Full Name Cannot Be Empty"}
Full Name: <input type="text" name="FullName" value="{$FullName|escape}"><br />
{validate id="phone" message="Phone Number Must be a Number"}
Phone :<input type="text" name="Phone" value="{$Phone|escape}" empty="yes"><br />
{validate id="expdate" message="Exp Date not valid"}
Exp Date: <input type="text" name="CCExpDate" size="8" value="{$CCExpDate|escape}"><br />
{validate id="email" message="Email not valid"}
Email: <input type="text" name="Email" size="30" value="{$Email|escape}"><br />
{validate id="date" message="Date not valid"}
Date: <input type="text" name="Date" size="10" value="{$Date|escape}"><br />
{validate id="password" message="passwords do not match"}
password: <input type="password" name="password" size="10" value="{$password|escape}"><br />
password2: <input type="password" name="password2" size="10" value="{$password2|escape}"><br />

<input type="submit">

I'm not sure what |escape does, but curiosity would impel me to delete them all and see what happens :)