Input form validation in Adobe Campaign

pradyumns539618

01-03-2018

Hi ,

I want to validate Input form if it's not matched with required data type ,throw the alert whenever user enter wrong data type value for ex: If the input filed of phone is integer(long) , it should accept only integer value .

Can anyone help me out here . Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

daniell35335226

07-03-2018

Hi,

You can do something like this :

                          <leave>

                                <check expr="@Phone)!=''">

                               <error>Your phone number is blank!</error>

                                </check>

                                <check expr="@Phone)!=''">

                                  <error>Your phone number is blank!</error>

                                </check>

                                <check expr="@Phone)!=''">

                                  <error>Your phone number is blank!</error>

                                </check>

                              </leave>

Hope that helps?

Dan

Answers (7)

Answers (7)

bobbyjss

MVP

25-07-2019

Unfortunately not Mike.

The landing pages are unable to validate against the profile schema. We have a problem with his as we're unable to identify if a profile already exists when someone fills in our subscription form because we're unable to validate against the email address.

It would make my life significantly easier if you could!

jyotiyadav3

04-03-2018

Hi,

You can use javascript element in the form and show alert whenever datatype is wrongly entered.

Eg; for integer you can use:

var x=document.getElementById("xyz");

if( x!=(int)x){

alert("Please enter numeric value");

}

You will be able to get the Element name when you load form in the browser, press F12 and inspect that element id.

Thanks,

Jyoti

michaeld2087442

23-07-2019

Hi guys,

It is possible to validate the input text before update the data details?

here's the scenario i want to implement.

i want to send a web form to members and before they change there details they need to input first there account number and if the account number is correct next page will show up, but if the account no is  not correct alert message will show up.

can you please help me for these?

regards,

Mike

pradyumns539618

07-03-2018

Hi Daniell,

Thanks for response !!

above syntax works only one field at a time , what if i have to validate multiple fields in the form?

any suggestion !

Thanks!

daniell35335226

02-03-2018

Here is an example :

  <leave>

       <check expr="@Phone)!=''">

      <error>Your phone number is blank!</error>

    </check>

  </leave>