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

arti1111
Level 1
Level 1

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

3 Replies
prasannakumarmarru
Level 4
Level 4

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!

arti1111
Level 1
Level 1

Hi @prasannam97453277

I try by adding [] also.

Still not able to validate white space.

Regards,

Arti

arti1111
Level 1
Level 1

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