Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Input form validation in Adobe Campaign

Avatar

Level 3

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!!

1 Accepted Solution

Avatar

Correct answer by
Level 2

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

View solution in original post

0 Replies

Avatar

Employee Advisor

You can make use of event based checks on input forms to validate it

Please refer to Form structure link and read more about it.

Avatar

Level 2

Here is an example :

  <leave>

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

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

    </check>

  </leave>

Avatar

Level 2

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

Avatar

Level 3

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!

Avatar

Correct answer by
Level 2

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

Avatar

Level 2

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

Avatar

Level 6

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!