In contact_us.php, when contact us query form is submitted, there's no effective validation to check if
necessary fields have been filled in.
Instead, only an "invalid email address error message" is displayed in the result with the caption
something like, "thank you, your query has been successfully submitted to the store owner". Most people
misunderstand this as their message having been delivered.
Actually, the store owner never gets the message if the email address is not inserted in the form while
submission.
This is somewhat confusing.
I was looking to alert the visitor in case of the incomplete form, BEFORE the query is submitted.
After constantly looking around, I couldn't find a contribution that would resolve this issue, so I quickly
"developed" my own.
All I did was to grab the form field validation javascript from www.dynamicdrive.com and altered a few
lines in the catalog/html_output.php file.
PLEASE NOTE: That the enclosed contact_us.php file is the same as the one in SUPER CONTACT US ENHANCEMENT.
This can be found here: http://addons.oscommerce.com/info/4029
This file is also included in the package so not to worry, I have only provided the information for
clarification.
A screenshot is included for demonstration prior to install.
Legend: 
Download

Report
If you want to have a standard OSC error message like on the create account screen, just add the following 3 lines to catalog/contact_us.php:
After:
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
Add:
if (tep_validate_email($email_address) == false) {
$error = true;
$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
Thats it, have fun!
This is a one line Simple Fix for the described problem.
Open contact_us.php
Find around line 82:
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
Change it to:
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && $messageStack->size('contact') < 1) {
That's it. Fixes the problem with saying the form was submitted when it wasn't.
Made a few changes to the installation instructions to already include the implied changes to the validation code. Also changed where "$onsubmit = 'return formCheck(this);" was placed (in contact_us.php instead of in html_output.php) to prevent conflict with other contribtuions that modify the form function.
Thank you to the author (MarXam) for a great contribution that definitely addresses the annoying problem associated with the e-mail error checking, and also adds great error checking functionality to other form fields.
In the previous release (v0.1)below, I realised there was a small error that converted all "BUY NOW" buttons into Form Submit buttons.
Although it didn't cause any errors, it didn't look good. I have addressed this issue and uploaded new COMPLETE PACKAGE.
Now everything is working exactly as it should be.
Instructions have also been updated for your convenience.
In contact_us.php, when contact us query form is submitted, there's no effective validation to check if
necessary fields have been filled in.
Instead, only an "invalid email address error message" is displayed in the result with the caption
something like, "thank you, your query has been successfully submitted to the store owner". Most people
misunderstand this as their message having been delivered.
Actually, the store owner never gets the message if the email address is not inserted in the form while
submission.
This is somewhat confusing.
I was looking to alert the visitor in case of the incomplete form, BEFORE the query is submitted.
After constantly looking around, I couldn't find a contribution that would resolve this issue, so I quickly
"developed" my own.
All I did was to grab the form field validation javascript from www.dynamicdrive.com and altered a few
lines in the catalog/html_output.php file.
PLEASE NOTE: That the enclosed contact_us.php file is the same as the one in SUPER CONTACT US ENHANCEMENT.
This can be found here: http://addons.oscommerce.com/info/4029
This file is also included in the package so not to worry, I have only provided the information for
clarification.
A screenshot is included for demonstration prior to install.