give each form field a unique ID.

if ((document.getElementById('field1').value == "") &&
(document.getElementById('field2').value == "")) {
     alert('foobar');
     return false;
}

that's the basic/most straightforward way.  there are some regex's for
JS that will also check to make sure there are no spaces in the field
name...which makes the validation a bit more effective.

On 4/30/06, Eric J. Hoffman <[EMAIL PROTECTED]> wrote:
> I know this isn't quite CF, but figure the folks around here have done
> this easily.
>
> I have two forms, and I just want to check if no value has been entered
> in either form, and pop to tell the user to enter something!  So I can't
> do a required field in my validation because they can fill in one of
> three fields or more in one form, but not the other.
>
> Anyway, I would check form1 and form2 for no values...I get that, but
> wonder how to check for nothing from each form.
>
> Thanks.
> --------------------------------------------------------
>
>
> Eric J. Hoffman
> Managing Partner
> 2081 Industrial Blvd
> StillwaterMN55082
> mail: [EMAIL PROTECTED]
> www: http://www.ejhassociates.com
> tel: 651.717.4105
> fax: 651.717.4115
> mob: 651.245.2717
>
> --------------------------------------------------------
>
> This message contains confidential information and is intended only for 
> [EMAIL PROTECTED] If you are not [email protected] you should not 
> disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] 
> immediately by e-mail if you have received this e-mail by mistake and delete 
> this e-mail from your system. E-mail transmission cannot be guaranteed to be 
> secure or error-free as information could be intercepted, corrupted, lost, 
> destroyed, arrive late or incomplete, or contain viruses. Eric J. Hoffman 
> therefore does not accept liability for any errors or omissions in the 
> contents of this message, which arise as a result of e-mail transmission. If 
> verification is required please request a hard-copy version.
> --------------------------------------------------------
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239151
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to