Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2010
    Location
    Florence, MS
    Posts
    484
    Thanks
    10
    Thanked 33 Times in 32 Posts

    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. ^_^

  • #2
    Regular Coder
    Join Date
    Oct 2010
    Location
    Florence, MS
    Posts
    484
    Thanks
    10
    Thanked 33 Times in 32 Posts
    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. ^_^

  • #3
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •