Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-09-2012, 06:16 AM   PM User | #1
Chris Hick
Regular Coder

 
Join Date: Oct 2010
Location: Florence, MS
Posts: 476
Thanks: 10
Thanked 33 Times in 32 Posts
Chris Hick is an unknown quantity at this point
SmartyValidate filling form values after submission

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???
__________________
Notice: If you post a problem and it gets fixed, please remember to go back and place it as solved. ;)
I always recommend the HEAD First series of books for learning a new coding language. ^_^
Chris Hick is offline   Reply With Quote
Old 08-12-2012, 10:19 PM   PM User | #2
Chris Hick
Regular Coder

 
Join Date: Oct 2010
Location: Florence, MS
Posts: 476
Thanks: 10
Thanked 33 Times in 32 Posts
Chris Hick is an unknown quantity at this point
Any one have any luck with this??
__________________
Notice: If you post a problem and it gets fixed, please remember to go back and place it as solved. ;)
I always recommend the HEAD First series of books for learning a new coding language. ^_^
Chris Hick is offline   Reply With Quote
Old 08-12-2012, 10:34 PM   PM User | #3
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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?

PHP Code:
    <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">
    </
form
I'm not sure what |escape does, but curiosity would impel me to delete them all and see what happens
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:31 PM.


Advertisement
Log in to turn off these ads.