Reply to Re: Check if any fields are filled in

Your name:

Reply:


Posted by james on 11/06/07 16:32

On Nov 6, 4:15 pm, Darko <darko.maksimo...@gmail.com> wrote:
> On Nov 6, 4:50 pm, mtuller <mitul...@gmail.com> wrote:
>
> > I am creating a page for nomination and want to let the information
> > pass if any field are filled out, but if none are filled out, a
> > message will appear. I can't get the check to happen on multiple
> > fields though.
>
> > Here is what I have:
> > if ($nominee_first_name !=='' && $nominee_middle_initial !=='' &&
> > $nominee_last_name !=='')
>
> > What happens is that if all fields have content, the page passes, and
> > all I care about is that there is something entered in at least one
> > field.
>
> Replace && with ||

Just expanding on Darko's answer - && means 'if condition 1 and
condition 2 are true'. || means 'if at least one condition is true'.
Both can be used with more than two conditions as well.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация