Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Location
    Jacksonville Fl
    Posts
    73
    Plugin Contributions
    0

    Default adding radio buttons to login page/restricting login

    I have looked all through the forums and do not see an answer for my question. My customer is using the cart to sell services some of which are very sensitive; his lawyers want customers to be required to agree to site terms at login or not be able to log in.

    I wanted to use radio buttons for the I Agree/Don't Agree choice but
    a) don't see anything to explain how to use radio buttons (I found the function function zen_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {
    return zen_draw_selection_field($name, 'radio', $value, $checked, $parameters);
    }) on the html_output.php file is this it? If so, what would the parameters be?
    b) not sure how to set this up to communicate with the database and to what table(s) I need to add fields.
    c) don't know where the login function is to add the restriction

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: adding radio buttons to login page/restricting login

    Admin> Configuration> Regulations - Enable the checkbox
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: adding radio buttons to login page/restricting login

    I'm not a laywer, but does this have to be every time one logs in?? Or is it sufficient to state that by creating an account that you agree to the terms only once? and then on subsequent logins not be bothered with this.

    In example: MS requires acceptance of their EULA whether you actually read it or not once and not on every use of their products.

    You can look at a couple of modules for adding things to the signup and while not specifically for terms agreement the text can be altered

    Like Confirm Email Address Entry module and/or the captcha module and glean the concept of adding additional requirements

    OPPS! Kim states that this is in the admin - live and learn
    Last edited by kobra; 26 Mar 2007 at 10:36 PM. Reason: Update
    Zen-Venom Get Bitten

  4. #4
    Join Date
    Mar 2006
    Location
    Jacksonville Fl
    Posts
    73
    Plugin Contributions
    0

    Default Re: adding radio buttons to login page/restricting login

    Kim, actually, that has to do with the create account screen and not the login.

    The header.php file for the modules/pages/login/ has commented out code to work with the privacy policy requirement but there is no corresponding code in the tpl_login_default.php file and my poor attempts at adding a checkbox to allow it to work have failed. I can login whether the checkbox is checked or not.

    I agree that having to do this every time is crazy but that is the requirement I have to work with.

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: adding radio buttons to login page/restricting login

    Code:
      /* Privacy-policy-read does not need to be checked during "login"
      if (DISPLAY_PRIVACY_CONDITIONS == 'true') {
      if (!isset($_POST['privacy_conditions']) || ($_POST['privacy_conditions'] != '1')) {
      $error = true;
      $messageStack->add('create_account', ERROR_PRIVACY_STATEMENT_NOT_ACCEPTED, 'error');
    I think that this states what I have highlighted and you will have to add a conditional to test for a checked box or radio from the page.

    add the draw button in the tpl file and check it with the js

    Look at the modules/pages/login/jscript_form_check.php for this:
    Code:
    function check_radio(field_name, message) {
      var isChecked = false;
    
      if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
        var radio = form.elements[field_name];
    
        for (var i=0; i<radio.length; i++) {
          if (radio[i].checked == true) {
            isChecked = true;
            break;
          }
        }
    
        if (isChecked == false) {
          error_message = error_message + "* " + message + "\n";
          error = true;
        }
    A new name added (grep for the file location where the above exists) add new name in those places and then similar code as above added to check if checked or not and associated error message...
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. v151 Validating new radio buttons I added to the login page
    By aestheticdesign in forum General Questions
    Replies: 2
    Last Post: 5 Jun 2014, 09:57 PM
  2. adding title Mrs radio button to login page
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 12 Oct 2010, 04:48 PM
  3. Login Page: Remove HTML & TEXT-Only Radio Buttons
    By MeltDown in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Jun 2009, 10:27 AM
  4. Code for the login and submit buttons on the login page
    By tkelley66 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Mar 2009, 04:58 AM
  5. Question - adding radio buttons to checkout-shipping page
    By bolson in forum Managing Customers and Orders
    Replies: 22
    Last Post: 10 Mar 2009, 06:34 AM

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