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

Learn More

View all

Sign in to view all badges

Validate white space and Null entry in adobe Campaign input Form

Avatar

Avatar
Boost 1
Level 1
arti1111
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
arti1111
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
arti1111
Level 1

19-11-2019

Hi,

I am currently working on adobe campaign input forms which will store user data such as First Name, email, ID, Groups. All the fields are of type="String" For validation, I use in input form           Mandatory field, Please Enter your First Name!     

<leave>      

<check expr="@firstName!=''">

      <error>Mandatory field, Please Enter your First Name!</error>

    </check>

  </leave>

But with this I am able to validate null entry but if the user enter white space it is stored. I need to get the same alert for white space also. I tried to achieve this through javascript also.

javaScript Code:-

function db-rdValidateJS-validate(name)

{

var x=document.getElementById(name);

var t=x.trim();

if(t.length=0)

{

alert(s+"input is invalid. Enter Correct Input");

}

return 1;

}

Soap call in input form:-
<soapCall name="validate" service="db:rdFile">
<param exprIn="[@firstName]"  type="string"/>
</soapCall>

And method call in data schema:-
<methods>
  <method library="db:rdValidateJs.js" name="validate">
      <parameters>
         <param inout="in" name="firstName" type="String"/>    
</parameters>  
</method>
</methods>

This is also not working "Error while compiling script" Can anyone please provide any how I  can validate white space also?

Thanks,

Arti

Replies

Avatar

Avatar
Give Back 5
Level 4
prasannakumarmarru
Level 4

Likes

51 likes

Total Posts

59 posts

Correct Reply

17 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Level 4
prasannakumarmarru
Level 4

Likes

51 likes

Total Posts

59 posts

Correct Reply

17 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
prasannakumarmarru
Level 4

19-11-2019

Hi,

I think you should try adding [] on firstName on check expression.

<leave>     

<check expr="[@firstName]!=''">

      <error>Mandatory field, Please Enter your First Name!</error>

    </check>

  </leave>

Thanks!

Avatar

Avatar
Boost 1
Level 1
arti1111
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
arti1111
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
arti1111
Level 1

19-11-2019

Hi @prasannam97453277

I try by adding [] also.

Still not able to validate white space.

Regards,

Arti

Avatar

Avatar
Boost 1
Level 1
arti1111
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
arti1111
Level 1

Likes

2 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
arti1111
Level 1

02-12-2019

Hi,

The version I am using is 6.1.1 adobe Campaign client console and still not able to validate the white space provided in input fields in input form. The input field is of string type. Can anyone please help me in validating white space ?

Regards,

Arti