:: Forum >> Version 2 >>

Formating input text field

Is it possible to format an input field to accept phone or zipcode formats, ie: ###-###-#### or #####-####.

Thanks

Ira
Ira Berkowitz
Tuesday, February 6, 2007
It is possible to monitor changes and modify cell contents with onCellTextChanging() event. Here is an example which only allows numeric characters -

obj.onCellTextChanging = function(textcolumnrow){

    if (
column == 1) { // column-1 only
        
if (text.match(/[^0-9.+-]/)){
            return 
"error"// prevent non-digits
        
}
    }
}
  
Something similar could work for phone/zipcodes(?)
Alex (ActiveWidgets)
Wednesday, February 7, 2007



This topic is archived.

Back to support forum

Forum search