Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: phpexcel validation issue for invalid values

$
0
0
Here's my problem, I have a validation in one of my excel.
$objValidation = $sheet->getCell('G17' )->getDataValidation();
$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_DECIMAL );
$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_STOP );
$objValidation->setOperator( PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHANOREQUAL);
$objValidation->setAllowBlank(true);
$objValidation->setShowInputMessage(true);
$objValidation->setShowErrorMessage(true);
$objValidation->setErrorTitle('Input error');
$objValidation->setError('Only numeric entries are allowed.');
$objValidation->setFormula1(0);
$objValidation->setPromptTitle('Allowed input');
$objValidation->setPrompt('Only numeric entries are allowed.');
When the user try to enter alphabet characters on 'G17' cell, user was prompted by the error message with the following buttons : "OK", "Cancel" , "Help" .

But when the user try to enter NUMERIC characters, the validation message appear again. Is there a way to validate alphabet characters ONLY..

Viewing all articles
Browse latest Browse all 2707

Trending Articles