Community Add-Ons

Maintainers: MarXam
Add file to this package
Top » Other

CONTACT US FIELD VALIDATION v0.1
for osCommerce Online Merchant v2.2

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
Expand All / Collapse All
Contact Us Standard OSC Error Message LED-Store 20 Feb 2008  

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!

Contact Us Validation One Line Simple Fix studio-owens 20 Feb 2008  
CONTACT US FORM FIELD VALIDATION v0.3 FULL PACKAGE giz286sim 12 Jan 2008  
CONTACT US FORM FIELD VALIDATION v0.2 FULL PACKAGE MarXam 29 Nov 2007  
CONTACT US FIELD VALIDATION v0.1 MarXam 28 Nov 2007