Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default How to pre-populate hidden field in php email form?

    One one of my clients shops the checkout success page requires the customer to provide additional details. The form is completed by the customer and then emailed to my client. This form needs to contain the order id relating to the just completed order.

    I can display that order id with the variable $special_orders_id ($special_orders_id = $zv_orders_id;)

    As it stands, the customer needs to enter the $special_order_number again. To avoid entering that id again, I want to make it a pre-populated hidden field which is then automatically added to the email.

    Here is the current form (or part thereof...) which is a modified band_signup plugin:


    <?php echo zen_draw_form('special_order', zen_href_link(FILENAME_SPECIAL_ORDER, 'action=send')); ?>

    <div id="specialOrderContent" class="content">

    <fieldset id="specialOrder-Info">
    <legend>Order Details</legend>
    <div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
    <br class="clearBoth" />
    <div id="checkoutSuccessOrderNumber"><?php echo TEXT_YOUR_ORDER_NUMBER . $special_orders_id; ?></div>
    <label class="inputLabel" for="special_order_number">Please enter your Order Number:</label>
    <?php echo zen_draw_input_field('special_order_number', zen_output_string_protected($special_order_number), ' size="30" id="special_order_number"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
    <br class="clearBoth" />
    </fieldset><br />

    [next fieldset - to be completed by customer]
    [next fieldset - to be completed by customer]

    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

    <br class="clearBoth" />
    </div>
    </form>
    and further down

    //assemble the email contents: (the modified code)

    $email_text = 'Additional Order Details: ' . "\n" .
    '------------------------------------------------------' . "\n" .
    'Special Order Number:' . "\t" . $special_order_number . "\n" .
    'cPanel URL:' . "\t" . $cPanel_URL . "\n" .
    'cPanel User:' . "\t" . $cPanel_user . "\n" .
    'cPanel Password:' . "\t" . $cPanel_pwd . "\n" .
    'Admin URL:' . "\t" . $admin_URL . "\n" .
    'Admin User:' . "\t" . $admin_user . "\n" .
    'Admin Password:' . "\t" . $admin_pwd . "\n" .
    'FTP URL:' . "\t" . $ftp_URL . "\n" .
    'FTP User:' . "\t" . $ftp_user . "\n" .
    'FTP Password:' . "\t" . $ftp_pwd . "\n" .
    'Comments:' . "\t" . $comments . "\n\n" .
    '------------------------------------------------------' . "\n" .

    etc etc
    Any hints how to achieve this please?

    Thanks / Frank
    Last edited by frank18; 18 Nov 2013 at 01:21 AM.

 

 

Similar Threads

  1. v139h How to remove pre-filled email address on Contact Us form?
    By jostar in forum General Questions
    Replies: 23
    Last Post: 24 Jan 2012, 06:38 PM
  2. Auto-Populate product_name In A Form Field?
    By zapme1 in forum General Questions
    Replies: 3
    Last Post: 26 Mar 2011, 04:38 PM
  3. Pre Populate Product Description Field?
    By PGlad in forum Basic Configuration
    Replies: 4
    Last Post: 10 Nov 2010, 06:58 PM
  4. Hidden Field in Create Account Form causing problems
    By marleyman in forum General Questions
    Replies: 11
    Last Post: 9 Feb 2008, 06:16 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