| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
$fillerror 'or' statement? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
$fillerror 'or' statement?
Hi Guys -
Sorry in advance if this is the dumbest question in the world... I want to enter an 'or' argument for checking completion of a form [I want the customers email address OR their phone number, but don't want to mandate both]. Plus I want to mandate a 'body' - a question, comment, whatever... It looks like a line like: $fillerror = (empty($contact["email"]) || empty($contact["phone"]) || empty($contact["body"])); ...constructs an 'either' argument - if either email or phone or body is blank, an error message pops up. I don't know the syntax for "$fillerror = [either phone or email empty] or body empty" - can anyone help? ps, for future reference, is $fillerror Smarty syntax, or php, or is it something specifically x-cart-y? Cheers |
|||||||
#2
|
|||||||||
|
|||||||||
Well, you could just make phone optional, email is required no matter what, especially if they are sending you an email... without it the mail wouldn't be sent.
You could do: Code:
But you'll need to remove the javascript client side check on the forms as well as in the $fillerror check. hth.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#3
|
|||||||
|
|||||||
Thanks, Boomer - I'll take your advice and keep it simple - I'll just make the phone number optional.
|
|||||||
|
|||
X-Cart forums © 2001-2020
|