Re: custom forms - data collection
this is part of my header file:
$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
$name = zen_db_prepare_input($_POST['contactname']);
$booktitle = zen_db_prepare_input($_POST['booktitle']);
$email_address = zen_db_prepare_input($_POST['email']);
$enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));
$zc_validate_email = zen_validate_email($email_address);
if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
// auto complete when logged in
if($_SESSION['customer_id']) {
$sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($sql);
$customer_email= $check_customer->fields['customers_email_address'];
$customer_booktitle= $check_customer->fields['customers_booktitle'];
$customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
} else {
$customer_email='Not logged in';
$customer_name='Not logged in';
Do i need to add anything here???
---------------------------
part of my contact us page:
define('ENTRY_NAME', 'Full Name:');
define('ENTRY_BOOKTITLE', 'Book Title:');
define('ENTRY_EMAIL', 'Email Address:');
define('ENTRY_ENQUIRY', 'Message:');
----------------------
part of my tpl_contact_us_default
<?php
// show dropdown if set
if (CONTACT_US_LIST !=''){
?>
<label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>
<?php echo zen_draw_pull_down_menu('send_to', $send_to_array, 0, 'id="send-to"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<?php
}
?>
<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($error ? $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label class="inputLabel" for="booktitle"><?php echo ENTRY_BOOKTITLE; ?></label>
<?php echo zen_draw_input_field('booktitle', $name, ' size="40" id="booktitle"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label for="enquiry"><?php echo ENTRY_ENQUIRY . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', '', 'id="enquiry"'); ?>
</fieldset>
REGARDS
VIK
Re: custom forms - data collection
Hi guys...ignore my previous two requests.
i have now basically created a new pop up window on the account default page.
So when they click sell a new window opens which is fine...
iv been through the start of this thread..but do not understand?!?
could you please guide me the correct way so that when a new window is opened a form is dispalyed which can be emailed to me:
form should consist of:
Name, email, book title, ISBN, autour etc
thanxs
Re: custom forms - data collection
If anyone has experience with this process could help...?
I'm close! Using the band signup demo, I've got the fields to show up. and the submit button to send the email.
The email shows up with the correct subject, from, and to. Except: it is HTML (which I don't really care about), but the body only says: $EMAIL_MESSAGE_HTML
Anyone have any ideas?
Thanks very much in advance...
Re: custom forms - data collection
Okay, so I made some progress....
How do i tell the email to be in text format only. If I switch my global setting to text only, it works perfect.
I would like to keep my global setting to HTML. But allow this email response to be in text....
Re: custom forms - data collection
Well, I found the easiest way for me was to duplicate all contact_us related files and rebuild from there...
seemed to work really well.
if someone else needs more help, feel free to pm me.
Re: custom forms - data collection
Learned a lot from this post! Thanks guys!
Re: custom forms - data collection
How do you change the field that are required to be filled out? I am working on a custom form and not all of the fields will need to be filled out. I copied the band_signup example so am running on that.
Re: custom forms - data collection
Nevermind. I figured it out.
However, there is another problem I am having. I have some text forms set-up for someone to enter in their password. In IE submitting the form works fine, however when in FireFox when I submit the form there is a pop-up and asks me to confirm which user I am changing the password for and then lists three of my login names, when I hit 'cancel' the page confirms that the answers have been sent and there are no further problems. How do I fix the pop up in Firefox?
Link to my form, in case anyone wants to take a look:
http://pinkcandydesigns.com/index.ph...rder_questions
Re: custom forms - data collection
pcdesigns,
i've heard of a similar problem before. I'll take a look on some forums. in the meantime, your form looks really really good.
congratulations.
Re: custom forms - data collection
Thanks!
I did (I think) figure out what the problem is. I've read that in Firefox the form-filler causes that pop-up about the 'confirm which user is changing their password'. Would anyone know if there is a code to use to automatically have that feature turned off and force the user to type their answers instead of using form-filler? I've seen that done with a few websites so I think it can be done.