Results 1 to 9 of 9
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default adding radio buttons to creat account

    I think that I'm a half inch away from getting this right! I used the email format but since that is a radio button dependent on a config setting to start with, maybe I've got stuff I don't need here. (this may well show my php ignorance - I hate to have to ask!)

    Here's the button from the tpl_modules_create_account.php:

    <?php echo zen_draw_radio_field('customers_resident', 'Yes', ($customers_resident == 'yes' ? true : false),'id="resident_yes"') . '<label class="radioButtonLabel" for="resident_yes">' . ENTRY_SEND_DOC_YES . '</label>' . zen_draw_radio_field('customers_resident', 'NO', ($customers_resident == 'No' ? true : false), 'id="resident_no"') . '<label class="radioButtonLabel" for="resident_no">' . ENTRY_SEND_DOC_NO. '</label>'; ?>

    I also tried leaving out the ($customers_resident == 'yes' ? true : false) on both buttons like this:

    <?php echo zen_draw_input_field('customers_resident', htmlspecialchars($cInfo->customers_resident, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_CUSTOMERS, 'customers_resident', 50), true) ; ?>

    and from the module create account just this since it's not dependent on a config setting like the email format:

    $customers_resident = zen_db_prepare_input($_POST['customers_resident']);

    and added to the data array:
    'customers_resident' => $customers_resident,

    I've added in quite a few new fields and everything works except the radio buttons (I have three sets of them). Nothing is getting put into the database but not even the defaults are left. So it looks like nothing is being posted from the create account form - ie, radio buttons aren't working!
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,965
    Plugin Contributions
    96

    Default Re: adding radio buttons to creat account

    Do you, by any chance, use the Super Globals plugin? It's minimally invasive and will display a wealth of information (like the values returned in the POST and GET arrays as well is internal variable values) to allow you to debug this kind of stuff.

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: adding radio buttons to creat account

    but you wrote it for 1.5 - this is a 1.3.9h cart
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  4. #4
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: adding radio buttons to creat account

    I finally got all this straighened out - it was all about misspellings in different places, not about the php. So glad I'm having vision surgery soon!
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  5. #5
    Join Date
    Sep 2012
    Posts
    10
    Plugin Contributions
    0

    Default Re: adding radio buttons to creat account

    Hi, I too am trying to add a couple of radio buttons to the login page (that request a simple Yes/No answer to a question). I could not follow exactly what this process entails. Could one of you guys simplify the stages for a new-coder like me?

  6. #6
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: adding radio buttons to creat account

    That's a big order. I'm no newbie at all and I had some difficulty picking my way thru this. Essentially what i did was take an existing set of radio buttons (the mr, ms or the html/email) and replacing the identifying bits with new terms. I went wrong when I misspelled something.

    You make changes in the includes/templates/your template/tpl_modules_create_account.php and includes/modules/create_account.php.

    Of course, you also add the corresponding new field to the customers table in the database.

    Not really a job for a newbie. There is a plugin that might be easier for you to fool with in the plugins section. I haven't used it myself: http://www.zen-cart.com/downloads.php?do=file&id=1137
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  7. #7
    Join Date
    Sep 2012
    Posts
    10
    Plugin Contributions
    0

    Default Re: adding radio buttons to creat account

    Cripes! Thanks, I will have a play. Regards.

  8. #8
    Join Date
    Sep 2012
    Posts
    10
    Plugin Contributions
    0

    Default Re: adding radio buttons to creat account

    Delia that link you sent me did the job for me. After a few problems (my own fault) I managed to install 4 fields on my login page. I even think I can convert these to radio buttons but have made do for the present.

  9. #9
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: adding radio buttons to creat account

    great - always check the mods - if they are recent, they probably work. If they aren't recent, sometimes you can find threads about them and be able to find out if there were/are problems with your version.
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

 

 

Similar Threads

  1. New Account Mr. / Ms. Radio Buttons???
    By MagicMan in forum General Questions
    Replies: 15
    Last Post: 3 Mar 2010, 06:58 PM
  2. Adding radio buttons or drop list.
    By Mike001 in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 2 Jun 2009, 08:21 PM
  3. Adding a Radio buttons to Description
    By CoolCarPartsOnline in forum General Questions
    Replies: 2
    Last Post: 30 Apr 2008, 07:33 PM
  4. Adding Radio Buttons
    By slabadoo in forum General Questions
    Replies: 2
    Last Post: 2 May 2007, 03:52 PM
  5. Adding Drop Down Menu or Radio Buttons
    By TurtleDove in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 12 May 2006, 08:58 PM

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