Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Dec 2007
    Posts
    85
    Plugin Contributions
    0

    Default Lock/Unlock Text box

    Hi all,

    I'd like to have the following:
    A locked text box (no user input possible), but when the customers checks a check box, the text box unlocks and input is possible.
    Can that be done (I want to have that on the comments text box at step 1 during checkout)?

    Hope someone can help me out.
    Thanks!

  2. #2
    Join Date
    Dec 2007
    Posts
    85
    Plugin Contributions
    0

    Default Re: Lock/Unlock Text box

    Ok, I found that this can be done with some simple javascript and an "onclick" function. However, I can't figure out how to add the onclick function to this dynamically generated checkbox. I'm using the gift wrapping module. This is the code:
    Code:
    <?php 
             // gift wrap setting
             echo '<td class="cartWrapCheckDisplay" id="testCheck" onclick="testCheck">'; 
             $prid = $order->products[$i]['id'];
             if (zen_get_products_virtual($order->products[$i]['id'])) {
                echo GIFT_WRAP_NA;
             } else if (DOWNLOAD_ENABLED && product_attributes_downloads_status($order->products[$i]['id'], $order->products[$i]['attributes'])) {
                echo GIFT_WRAP_NA; 
             } else if ($wrap_mod->exclude_product($prid)) {
                echo GIFT_WRAP_NA; 
             } else if ($wrap_mod->exclude_category($prid)) {
                echo GIFT_WRAP_NA; 
             } else { 
                $gift_id = "wrap_prod_" . $prod_count;
    			echo zen_draw_checkbox_field($gift_id,'',false, 'id="'.$gift_id .'"');  
             }
             echo "</td>"; 
    ?>
    How would I add an onclick function to the $gift_id checkbox?

    Thanks!
    Jurjen

  3. #3
    Join Date
    Dec 2007
    Posts
    85
    Plugin Contributions
    0

    Default Re: Lock/Unlock Text box

    Hi,

    Does someone have any ideas?

    Thanks!

  4. #4
    Join Date
    Dec 2007
    Posts
    85
    Plugin Contributions
    0

    Default Re: Lock/Unlock Text box

    Who who who who who can help me

  5. #5
    Join Date
    Dec 2007
    Posts
    85
    Plugin Contributions
    0

    Default Re: Lock/Unlock Text box

    Got it.
    I have duplicated, renamed and altered the following functions: zen_draw_selection_field and
    zen_draw_checkbox_field
    html_output.php

    The function zen_draw_checkbox_field, returns the zen_draw_selection_field. In the zen_draw_selection_field, I have added a viariable to be returned (the onclick function). I call this function on the specific page, via the template file, and specify the onclick within the template file. The onclick calls a bit of javascirpt that does the trick.

 

 

Similar Threads

  1. Text box with Max Characters set - text disappears
    By breda in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 27 Jul 2010, 01:06 PM
  2. Text Box Attribute - text not wrapping in shopping cart
    By cowgirlmodel in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 23 Oct 2009, 07:00 PM
  3. Replies: 0
    Last Post: 15 Dec 2008, 06:26 AM
  4. Replace text/html description text box with GUI editor
    By coolman in forum General Questions
    Replies: 3
    Last Post: 4 Dec 2008, 10:36 PM
  5. Attribute Text does not show text entry box, HELP!
    By dinki in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 8 Nov 2006, 01:14 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