Page 1 of 2 12 LastLast
Results 1 to 10 of 259

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Posts
    103
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Diva hope you're good today!! Yes, you guessed it, today I am struggling with "pull_down menus" - implemented this suggested code, but on the form it displays a blank drop-down menu. If I leave all fields blank and then press "Submit" , as expected, it brings up errors for all the other fields, NOT the drop-down one, but viola!, the pulldown field is magically populated. Any ideas on what I am doing wrong here, seeing that you've mastered it?

    here is my code:

    HEADER_PHP:
    // Pulldown to select a country
    // Set default selection:
    $default_pulldown_selection = '0';

    //For validation, you're looking for the contents of the $_POST['choir_country'] variable
    // this is only set after "submit" is clicked.
    $pulldown_selected_item = (isset($_POST['choir_country'])) ? $_POST['choir_country'] : $default_pulldown_selection ;

    //build an array of entries to be displayed on the template for field 'choir_country':
    $pulldown_contents[] = array('id'=>'0', 'text'=>'Please Select');
    $pulldown_contents[] = array('id'=>'1', 'text'=>'England');
    $pulldown_contents[] = array('id'=>'2', 'text'=>'Wales');
    $pulldown_contents[] = array('id'=>'3', 'text'=>'Scotland');
    $pulldown_contents[] = array('id'=>'4', 'text'=>'Northern Ireland');

    // Validation for the 'choir_country' selected field here.
    if ($pulldown_selected_item==0) {
    $messageStack->add_session('header','You must select a country, please','error');
    }
    TEMPLATE:
    <label class="inputLabel" for="choir_country">Which country are you in?:</label>
    <?php echo zen_draw_pull_down_menu('choir_country', $pulldown_contents, $pulldown_selected_item); ?>
    <br class="clearBoth" />
    Any ideas at all?

    Cheers

    Cliff

  2. #2
    Join Date
    Jul 2009
    Posts
    103
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    I figured out that the pulldown field contents are only generated AFTER the submit button is pressed. Any ideas how it could be generated BEFORE the submit button is pressed, i.e. on first display of the form?

    Thanks

    Cliff

  3. #3
    Join Date
    Jul 2009
    Posts
    103
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    All

    Please pardon my stupidity. I have figured it out now and its sorted. :) It's all about WHERE I place the code for this - it should be placed BEFORE the "if (isset($_GET['action']) && ($_GET['action'] == 'send'))" line in the form handler file to work propely. I placed it after that. duh!!

    Hope this helps other newbies too!

    Cheers

    Cliff

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

    Default Re: custom forms - data collection

    Good Morning Cliff..

    I have had a good laugh reading your dropdown field evolution..

    All I had mastered was the dropdown field validation so that the "Select One" value errored out if selected.. It looks like you figured out how to get the dropdown field to populate with the array from the header_php file.. (that was the part that STUMPED me..)

  5. #5
    Join Date
    Jan 2009
    Posts
    50
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Hello

    Drbyte

    thank you very much for the module:
    http://www.zen-cart.com/forum/showpo...2&postcount=72

    It was very useful

    I added many pages using it and it works, but sudenly after the form is sent I have a blank white page, I have no clue why??

    my page is:
    http://jeshop.ma/index.php?main_page=band_signup

    after i send i get white page:
    http://jeshop.ma/index.php?main_page...up&action=send

    Your help is very apprciated
    ...........Being zenned............

  6. #6
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: custom forms - data collection

    Quote Originally Posted by joudesign View Post
    ...I have a blank white page...
    FAQ on troubleshooting blank pages: https://www.zen-cart.com/tutorials/index.php?article=82
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jan 2009
    Posts
    50
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Thank you drByte

    I tried that but no clue

    I re - installed a new band-signup files and I get the blank page

    when i show the errors, when i press send button, I get:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/jeshop/public_html/includes/local/configure.php:1) in /home/jeshop/public_html/includes/functions/sessions.php on line 108

    Notice: Constant OFFICE_IP_TO_HOST_ADDRESS already defined in /home/jeshop/public_html/includes/languages/french/email_extras.php on line 56

    Notice: Constant OTHER_IMAGE_ already defined in /home/jeshop/public_html/includes/languages/french/other_images_names.php on line 35

    Notice: Constant OTHER_IMAGE_ already defined in /home/jeshop/public_html/includes/languages/french/other_images_names.php on line 36

    Notice: Constant OTHER_IMAGE_ already defined in /home/jeshop/public_html/includes/languages/french/other_images_names.php on line 37

    Notice: Constant OTHER_IMAGE_ already defined in /home/jeshop/public_html/includes/languages/french/other_images_names.php on line 38

    Notice: Constant BUTTON_IMAGE_GOTO_PROD_DETAILS already defined in /home/jeshop/public_html/includes/languages/french/other_images_names.php on line 44

    Notice: Constant BUTTON_GOTO_PROD_DETAILS_ALT already defined in /home/jeshop/public_html/includes/languages/french/other_images_names.php on line 68

    Warning: Cannot modify header information - headers already sent by (output started at /home/jeshop/public_html/includes/local/configure.php:1) in /home/jeshop/public_html/includes/init_includes/init_templates.php on line 78
    
    Notice: Constant HEADING_TITLE already defined in /home/jeshop/public_html/includes/languages/french/band_signup.php on line 23

    Notice: Undefined variable: email_text in /home/jeshop/public_html/includes/modules/pages/band_signup/header_php.php on line 194

    Notice: Undefined index: EMAIL_TO_NAME in /home/jeshop/public_html/includes/functions/functions_email.php on line 83

    Notice: Undefined index: EMAIL_TO_ADDRESS in /home/jeshop/public_html/includes/functions/functions_email.php on line 84

    Notice: Undefined index: EMAIL_SUBJECT in /home/jeshop/public_html/includes/functions/functions_email.php on line 85

    Notice: Undefined index: EMAIL_FROM_NAME in /home/jeshop/public_html/includes/functions/functions_email.php on line 86

    Notice: Undefined index: EMAIL_FROM_ADDRESS in /home/jeshop/public_html/includes/functions/functions_email.php on line 87

    Notice: Undefined variable: email_reply_to_address in /home/jeshop/public_html/includes/functions/functions_email.php on line 219

    Notice: Undefined variable: email_reply_to_name in /home/jeshop/public_html/includes/functions/functions_email.php on line 220

    Warning: Cannot modify header information - headers already sent by (output started at /home/jeshop/public_html/includes/local/configure.php:1) in /home/jeshop/public_html/includes/functions/functions_general.php on line 44

    ---------

    Your help is appreciated , it was working and I have no clue what caused this
    ...........Being zenned............

  8. #8
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    187
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    WOW.... this 3 year old post, just MADE MY FREAKIN DAY

    I was able to finally create my contact page with a Dropdown in the Subject Line and have it actually show up in the email correctly.
    Thanks so much for posting. This COMPLETE THREAD HAS BEEN HEAVEN SENT!!

    Actual Contact Page:

    Click image for larger version. 

Name:	contact.JPG 
Views:	222 
Size:	44.7 KB 
ID:	10340


    This is the Email Rendering after I hit the send button:
    Click image for larger version. 

Name:	Email_Contact.JPG 
Views:	225 
Size:	29.5 KB 
ID:	10341


    If you like the *Event Date* little dropdown, I found it on another Zen Thread, but the script can be found at http://www.dynamicdrive.com/dynamici...oncalendar.htm

    ***OFFICIALLY TIME TO DONATE****
    But Where in the World is the Donate Button Now... gotta find it, Not use to this new format yet LOL

    ------------------------------------------


    Quote Originally Posted by cliffvt View Post
    Diva hope you're good today!! Yes, you guessed it, today I am struggling with "pull_down menus" - implemented this suggested code, but on the form it displays a blank drop-down menu. If I leave all fields blank and then press "Submit" , as expected, it brings up errors for all the other fields, NOT the drop-down one, but viola!, the pulldown field is magically populated. Any ideas on what I am doing wrong here, seeing that you've mastered it?

    here is my code:

    HEADER_PHP:
    TEMPLATE:
    Any ideas at all?

    Cheers

    Cliff
    Last edited by ljdream00; 20 Apr 2012 at 02:32 PM.

  9. #9
    Join Date
    Jul 2011
    Posts
    23
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Quote Originally Posted by ljdream00 View Post
    WOW.... this 3 year old post, just MADE MY FREAKIN DAY

    I was able to finally create my contact page with a Dropdown in the Subject Line and have it actually show up in the email correctly.
    Thanks so much for posting. This COMPLETE THREAD HAS BEEN HEAVEN SENT!!

    Actual Contact Page:

    Click image for larger version. 

Name:	contact.JPG 
Views:	222 
Size:	44.7 KB 
ID:	10340


    This is the Email Rendering after I hit the send button:
    Click image for larger version. 

Name:	Email_Contact.JPG 
Views:	225 
Size:	29.5 KB 
ID:	10341


    If you like the *Event Date* little dropdown, I found it on another Zen Thread, but the script can be found at http://www.dynamicdrive.com/dynamici...oncalendar.htm

    ***OFFICIALLY TIME TO DONATE****
    But Where in the World is the Donate Button Now... gotta find it, Not use to this new format yet LOL

    ------------------------------------------
    I'm glad you were able to get your form up and running like you wanted. I threw my arms up in the air once I did it.

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: custom forms - data collection

    I just use Appnitro's MachForm system and can create ANY form you care to mention (and embed it on my ZC sites) in under 3 minutes...
    20 years a Zencart User

 

 
Page 1 of 2 12 LastLast

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