I want to to some validation for Sharepoint 2010 list column to not to allow special characters and white spaces.

Please let me know if any JS or Validation formula.


To check special characters I think you need JS validation. To do that, just load or inject the following js function into your edit/new form .aspx

function PreSaveAction(){
    var format = /[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/;
    var fldName = 'Title';
    var fldType = 'Text'
    var ctrl = $('[id^='+fldName+'_][id$='+fldType+'Field]');
    if(ctrl && !format.test(ctrl.val())){
       return true;
    return false;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.