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