Input form validation in Adobe Campaign | Community
Skip to main content
Level 2
March 1, 2018
Solved

Input form validation in Adobe Campaign

  • March 1, 2018
  • 8 replies
  • 10424 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by daniell35335226

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

8 replies

vraghav
Adobe Employee
Adobe Employee
March 2, 2018

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.

Level 2
March 2, 2018

Here is an example :

  <leave>

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

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

    </check>

  </leave>

jyotiyadav3
Level 2
March 5, 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

Level 2
March 7, 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!

daniell35335226Accepted solution
Level 2
March 7, 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

Level 2
March 8, 2018

Hi ,

yes , it works.

Thanks!!

Level 2
July 23, 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

El_Loco
Level 5
July 25, 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!