Re: [concrete] Field Validation
Hi Concrete,
A simple test that many of us use to check and add the http:// to the beginning of a URL on a list page is:
<?php foreach ($your_tableRecords as $record ): ?>
<?php
if (!preg_match("/^http:\/\//", $record['web_site'])) {
$record['web_site'] = "http://" . $record['web_site']; }
?>
<?php endif ?>
<?php endforeach; ?>
and on a detail page:
<?php
if (!preg_match("/^http:\/\//", $your_tableRecord['web_site'])) {
$your_tableRecord['web_site'] = "http://" . $your_tableRecord['web_site']; }
?>
<?php endif ?>
If that's not enough, you can do a Google search for validate url php
You'll find a great deal of information about creating a regular expression (REGEX) to validate the form of a URL
Then do a search here on the forum for $errorsAndAlert and you'll find many examples of how to implement advanced error checking in a form.
Hope that helps get you going.
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php