Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

$fillerror 'or' statement?
 
Reply
   X-Cart forums > X-Cart 4 > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-31-2003, 06:50 PM
 
lesmckeown lesmckeown is offline
 

Newbie
  
Join Date: Mar 2003
Posts: 3
 

Default $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
Reply With Quote
  #2  
Old 03-31-2003, 07:52 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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:
if(empty($contact["email"])) $contact["email"]="someemail@email.com";

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.
Reply With Quote
  #3  
Old 04-01-2003, 02:16 AM
 
lesmckeown lesmckeown is offline
 

Newbie
  
Join Date: Mar 2003
Posts: 3
 

Default

Thanks, Boomer - I'll take your advice and keep it simple - I'll just make the phone number optional.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:26 PM.

   

 
X-Cart forums © 2001-2020