Re: custom forms - data collection
Diva, on an aside matter, do you have any idea where I can find some code for allowing the "manufacturer" in this instance to also upload a file together with the form? I think the one I found in the forum only works with attributes on the product selection screens...
Thanks a lot
Cliff
Re: custom forms - data collection
Quote:
Originally Posted by
cliffvt
Diva, on an aside matter, do you have any idea where I can find some code for allowing the "manufacturer" in this instance to also upload a file together with the form? I think the one I found in the forum only works with attributes on the product selection screens...
Thanks a lot
Cliff
I did a half a$$ed search for something like that a while back and had no luck..:laugh:
My suggestion is to investigate the commercial section here or Rent-a-Coders.. (I've had good success with both) I am working with a coder now on two custom forms.. I had to have these created because of the somehwhat complex validation in both forms.. (which was beyond my skillset to create even using the band_signup zipfile as a template)
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:
Quote:
// 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:
Quote:
<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
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
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
Re: custom forms - data collection
Good Morning Cliff..
:laugh::laugh:I have had a good laugh reading your dropdown field evolution..:laugh::laugh:
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..):clap::clap:
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
Re: custom forms - data collection
Quote:
Originally Posted by
joudesign
...I have a blank white page...
FAQ on troubleshooting blank pages: https://www.zen-cart.com/tutorials/index.php?article=82
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
Re: custom forms - data collection