Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default How to Retain Form Data?

    I have added a few text fields and drop down boxes to my registration form, and I have everything working. I am confused as to how I can repost the user's entries in my new fields like zen cart will repost firstname, telephone, etc. when they are sent back to the form after clicking submit because of any errors.

    Does anyone know what file(s) this takes place in, or how it works?

  2. #2
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: How to Retain Form Data?

    Does nobody know how this works?.....

    I have some custom fields that don't get their data reposted upon a validation error like zen carts default fields do. Can anyone tell me how I can get this functionality to work??

  3. #3
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: How to Retain Form Data?

    Can we know how have you added these custom fields?
    Tutorials on Zen Cart
    http://tutorials.zen-cart.com/index.php
    ---------------
    advanced.programmer at gmail dot com
    In love with Zen Cart!!

  4. #4
    Join Date
    Jan 2007
    Posts
    50
    Plugin Contributions
    0

    Default Re: How to Retain Form Data?

    Quote Originally Posted by superprg View Post
    Can we know how have you added these custom fields?
    By creating new database fields in address_book table -> I insert my custom shipping fields into these new fields and then they get put as the delivery address in the orders table

    By modifying tpl_modules_create_account.php -> This file contains the form fields, I've basically took how the other fields were built and modified the variable names and their form text.

    By modifying create_account.php -> This files contains the database inserts, so you need to add inserts for you fields to go into the table you have made your new fields in the database (address_book, customers, etc..)


    Basically I just started with the firstname field, in tpl_modules_create_account.php, and just followed how it was built and inserted into the database in create_account.php, and then I figured out what places in the database it gets put into, and just emulated it for my first custom field. If the custom field you insert will be a "required" field you will also have to add a check for it, but I can't remember the file off the top of my head.

    If you have anymore questions, let me know...and make sure you back up your files before you try it.
    Last edited by brycej2; 7 Sep 2007 at 09:15 PM.

 

 

Similar Threads

  1. Replies: 2
    Last Post: 16 Jun 2011, 04:11 PM
  2. Retaining data in form submission
    By ethangreen in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Jun 2009, 08:53 PM
  3. How to process contact form with new fields data
    By corvettesalvage in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 30 May 2009, 05:33 PM
  4. Replies: 3
    Last Post: 16 May 2009, 10:53 PM
  5. Replies: 13
    Last Post: 3 Sep 2007, 11:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR