Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2006
    Posts
    9
    Plugin Contributions
    0

    Default Prechecked fields in Login Page

    Hey Everyone!

    I'm so close to being done, if you have Firefox or Safari please take a look at this link:


    https://membership.puppeteers.org/in...ain_page=login

    if you scroll all the way down to the bottom you'll see that the DO NOT boxes are all prechecked.

    I have looked at the code, but I can't seem to figure out how to have them default to being unchecked. Here's a snippet of code from my tpl_modules_create_account.php

    <?php echo zen_draw_checkbox_field('directoryphone', '1', $directoryphone, 'id="directoryphone-checkbox"') . '<label class="checkboxLabel" for="directoryphone-checkbox">' . ENTRY_DIRECTORYPHONE . '</label>' . (zen_not_null(ENTRY_DIRECTORYPHONE_TEXT) ? '<span class="alert">' . ENTRY_DIRECTORYPHONE_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />

    any thoughts? I'd love some help on this one!
    thanks a bunch,
    z.

  2. #2
    Join Date
    Mar 2007
    Posts
    159
    Plugin Contributions
    0

    Default Re: Prechecked fields in Login Page

    Interesting, removing the checked="checked" using firebug clears the 'on' state from the fax and email lines, but not the phone number line.

    anywho, did you clone the Subscribe to Our Newsletter to make the new questions? I'm not sure if its populating the information directly from the page or pulling it out of a database like the default Subscribe does, that will effect where the changes need to be made.

    as an aside, it still says copyright zen in the footer, but that is a subject for another post
    Lazy and willing to work very hard to stay that way

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,726
    Plugin Contributions
    6

    Default Re: Prechecked fields in Login Page

    IF the 3rd paramater is true, then they are checked by default ...

    IF the 3rd paramater is false, then they are unchecked by default ...

    How are you setting the 3rd paramater of the:
    PHP Code:
    zen_draw_checkbox_field('directoryphone''1'$directoryphone'id="directoryphone-checkbox"'
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  4. #4
    Join Date
    Mar 2007
    Posts
    159
    Plugin Contributions
    0

    Default Re: Prechecked fields in Login Page

    oh sure, break out the big guns on me
    Lazy and willing to work very hard to stay that way

  5. #5
    Join Date
    Oct 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: Prechecked fields in Login Page

    Hi Ajeh,

    thanks so much for your advice - I have to admit that I am unsure as to what the 3rd Parameter is...

    I have been kind of fumbling through this over the last couple of months, having a very strong knowledge of HTML and learning how to read the PHP as I go. For this instance I copied the newsletter code and then modified it to create what I needed below.

    Miraculously it's all getting read by the database and the customer admin successfully :)

    Here's a bit more of the code from the section I believe the problem is in below - again it's from the tpl_modules_create_account.php

    <?php
    if (ACCOUNT_NEWSLETTER_STATUS != 0) {
    ?>

    <?php echo zen_draw_checkbox_field('newsletter', '1', $newsletter, 'id="newsletter-checkbox"') . '<label class="checkboxLabel" for="newsletter-checkbox">' . ENTRY_NEWSLETTER . '</label>' . (zen_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="alert">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />

    <?php echo zen_draw_radio_field('playboard', 'ONLINE', ($playboard == 'ONLINE' ? true : false),'id="playboard-online"') . '<label class="radioButtonLabel" for="playboard-online">' . ENTRY_PLAYBOARD_ONLINE_DISPLAY . '</label>' . zen_draw_radio_field('playboard', 'SNAIL', ($playboard == 'SNAIL' ? true : false), 'id="playboard-snail"') . '<label class="radioButtonLabel" for="playboard-snail">' . ENTRY_PLAYBOARD_SNAIL_DISPLAY . '</label>'; ?>
    <br class="clearBoth" />

    <?php echo zen_draw_checkbox_field('directoryphone', '1', $directoryphone, 'id="directoryphone-checkbox"') . '<label class="checkboxLabel" for="directoryphone-checkbox">' . ENTRY_DIRECTORYPHONE . '</label>' . (zen_not_null(ENTRY_DIRECTORYPHONE_TEXT) ? '<span class="alert">' . ENTRY_DIRECTORYPHONE_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />

    <?php echo zen_draw_checkbox_field('directoryfax', '1', $directoryfax, 'id="directoryfax-checkbox"') . '<label class="checkboxLabel" for="directoryfax-checkbox">' . ENTRY_DIRECTORYFAX . '</label>' . (zen_not_null(ENTRY_DIRECTORYFAX_TEXT) ? '<span class="alert">' . ENTRY_DIRECTORYFAX_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />

    <?php echo zen_draw_checkbox_field('directoryemail', '1', $directoryemail, 'id="directoryemail-checkbox"') . '<label class="checkboxLabel" for="directoryemail-checkbox">' . ENTRY_DIRECTORYEMAIL . '</label>' . (zen_not_null(ENTRY_DIRECTORYEMAIL_TEXT) ? '<span class="alert">' . ENTRY_DIRECTORYEMAIL_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />

    <?php } ?>

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,726
    Plugin Contributions
    6

    Default Re: Prechecked fields in Login Page

    If you look at this function:
    Line #413 : function zen_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {
    The 3rd parameter is what you are passing as $checked ...

    In this case you are using:
    $directoryphone
    $directoryfax
    $directoryemail

    If those are set to true, then the boxes will be checked ...

    If those are set to false, then the boxes will be unchecked ...

    Where are you setting the values for those variables and what are the values that you have set them to?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7
    Join Date
    Oct 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: Prechecked fields in Login Page

    Hi Ajeh,

    I've found the code that you quoted in your reply within the html_output.php files

    I've done some searching and as far as I can tell I have not set the values for those three variables. I am unsure exactly what code to write to do that, and where I should put it...

    Thanks so much for all your help,
    -z.

  8. #8
    Join Date
    Oct 2006
    Posts
    9
    Plugin Contributions
    0

    Default Re: Prechecked fields in Login Page

    Hey Everyone!

    I GOT it! I basicallly just replaced $directoryphone with false:

    PHP Code:
    zen_draw_checkbox_field('directoryphone''1'$directoryphone'id="directoryphone-checkbox"'

    zen_draw_checkbox_field('directoryphone''1'false'id="directoryphone-checkbox"'
    Thanks for all your help!
    -z.

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,726
    Plugin Contributions
    6

    Default Re: Prechecked fields in Login Page

    Glad that you got that fixed and working now ... thanks for the update ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

 

 

Similar Threads

  1. Frustrating Problem - Login Page Issue
    By DiZZ in forum General Questions
    Replies: 0
    Last Post: 18 Dec 2006, 08:38 PM
  2. two login box on index page
    By vr4indian in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Nov 2006, 08:57 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
  •