Results 1 to 10 of 259

Threaded View

  1. #11
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: custom forms - data collection

    So I need a little clarification.

    I need to add a few radioboxes and some dropdowns. I have SCOURCED this forum for answers, and the closest I've come are these two threads:
    http://www.zen-cart.com/forum/showpo...2&postcount=12

    &

    http://www.zen-cart.com/forum/showpo...34&postcount=2

    The first link makes perfect sense to my non-coding brain, and would be easy for me to implement.

    I couldn't get the second one to work. (the dropdown showed fine, but it was not populated) Since I am no coder, I am sorta stumped in trying to troubleshoot why I couldn't get it to work.

    So here's my question. I was reading a post from DrByte (http://www.zen-cart.com/forum/showpo...93&postcount=2) that stated:
    Quote:
    Originally Posted by hyperspeed9
    I need make the list using Zen Carts method so that I can pass whatever a custom selects to be included in the email that is sent upon submission.


    Actually, you don't.

    All you need to do is check the value of the $_POST['merchant_desired'] variable, since that's what's set when someone chooses something from the SELECT ... OPTION .... OPTION ... OPTION ... /SELECT list you built in HTML.
    So if I understand this response correctly, I can add the following to my form:
    Code:
    <label class="inputLabelQuestions" for="question5">Have you had experience with premium hair?:<?php echo '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
    <select name="question5" id="question5">
      <option value="[Select One]">[Select One]</option>
      <option value="Yes">Yes</option>
      <option value="No">No</option>
      <option value="Not sure what premium hair is">Not sure what premium hair is</option>
    </select>
    and as long as I configure my header_php.php file correctly, this should be okay.. Am I understanding this correctly??
    Code:
      if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
        $contact1_firstname = zen_db_prepare_input($_POST['contact1_firstname']);
        $contact1_lastname = zen_db_prepare_input($_POST['contact1_lastname']);
        $contact1_phone = zen_db_prepare_input($_POST['contact1_phone']);
        $contact1_email = zen_db_prepare_input($_POST['contact1_email']);
        $contact2_phone = zen_db_prepare_input($_POST['contact2_phone']);
        $question1 = zen_db_prepare_input($_POST['question1']);
        $question2 = zen_db_prepare_input($_POST['question2']);
        $question3 = zen_db_prepare_input($_POST['question3']);
        $question4 = zen_db_prepare_input($_POST['question4']);
        $question5 = zen_db_prepare_input($_POST['question5']);
        $question6 = zen_db_prepare_input($_POST['question6']);
        $question7 = zen_db_prepare_input($_POST['question7']);
        $question8 = zen_db_prepare_input($_POST['question8']);
        $code = zen_db_prepare_input($_POST['code']);
        $comments = zen_db_prepare_input(strip_tags($_POST['comments']));
    Last edited by DivaVocals; 27 Jun 2009 at 02:52 AM.

 

 

Similar Threads

  1. custom survey forms
    By cpk in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 2 May 2011, 05:07 PM
  2. Custom Forms
    By wwiii in forum General Questions
    Replies: 3
    Last Post: 11 May 2009, 05:51 PM
  3. Customer's seeing other users' data in forms
    By erikcw in forum General Questions
    Replies: 5
    Last Post: 30 Jan 2008, 11:30 PM
  4. Custom Collection of Attribute Data
    By Fastcar in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2008, 01:01 PM
  5. Custom Forms - Help?
    By TurtleDove in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 9 Jun 2006, 02:46 AM

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