4 Replies Latest reply on Oct 29, 2007 6:23 PM by (Rayne)

    require either field

      Hi--
      Using ADDT, is there a way to require either one field (such as email) or another field (such as phone number) before the form is submitted? I don't want to require both field, but make sure one of the fields is filled out.
      Thanks.
      --Meredith
        • 1. Re: require either field
          Günter Schenk Level 4
          Hi Meredith,

          according to the "conditional required fields" thread at the Interakt forums (http://www.interaktonline.com/Products/Dreamweaver-Extensions/FormValidation/Product-For um/Details/117785/Conditional+Required+fields....html)

          it seems that this feature is not fully supported.

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: require either field
            Level 1
            Hi Gunter--<br />Thanks for the link. I had searched the old forums but hadn't found that particular link. I was thinking of something like adding a conditional trigger before the validation trigger:<br />-----------------------------------------------------<br />function Trigger_Custom(&$tNG) {<br />if ($_POST['email'] == '' || $_POST['phone'] == '') { <br />echo "<scriptlanguage=javascript>alert('Please enter an email address or a phone number')</script>";<br />}<br />}<br />------------------------------------------------------<br />but I can't seem to get it to trigger. Maybe javascript isn't support in custom triggers?<br />--Meredith
            • 3. Re: require either field
              Günter Schenk Level 4
              Hi Meredith,

              ----
              Maybe javascript isn't support in custom triggers?
              ----

              no, ADDT´s custom triggers are related to server-side functionality only -- but maybe it could be worth giving SPRY´s form validations a try ? AFAIK this one does allow for conditional validation, and from my own experiments I see it´s very easy to add at least Spry´s validations to ADDT forms.

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: require either field
                Level 1
                Thanks, Gunter, for the reply. I will try SPRY's form validation. Good idea.
                --Meredith