Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Urgent !!! How to trim spaces of an email filed ?

$
0
0

Hi,

 

I have an email field in a form ,which have a validation at the time of submission of form as shown in the below .

 

function isEmailValid(fld){

                    var result = true;

                    if(fld != null){

                              var r = new RegExp();

                        r.compile("^[a-z0-9_\\-\\.\\']+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,4}$","i" );

                              result = r.test(fld.rawValue);

                    }

                    return result;

          }

 

but if user by mistakely enters the space in that field  at the time of validation it is  showing an error called "Invalid Email Format"

 

I need to trim those spaces either modifying the above regular expression or the best way

 

Please suggest ..

 

Thanks in Advance

Bharathi


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>