You are here

README.txt in Brazilian IDs 7

Same filename and directory in other branches
  1. 6 README.txt
This module adds 3 new widgets to the text field type at the Field UI.

They are:
CPF - Accepts only valid tax number of individuals
CNPJ - Accepts only valid tax number of companies
CPF / CNPJ - Accepts either one as long as it is a valid number

Learn more about these Brazilian tax numbers at wikipedia:
CPF and CNPJ

The view format display are done as followed:
CPF - 999.999.999-99
CNPJ - 99.999.999/9999-99

This module also adds 3 new field types for the Form API.
They are:
number_cpf, number_cnpj and number_cnpj_cpf

So, developers can easily build form elements of Brazilian Tax Number types.
For example:

  $form['my_cpf_field'] = array(
    '#type' => 'number_cpf',
    '#title' => t('CPF'),
  );
  $form['my_cnpj_field'] = array(
    '#type' => 'number_cnpj',
    '#title' => t('CNPJ'),
  );
  $form['my_cnpj_cpf_field'] = array(
    '#type' => 'number_cnpj_cpf',
    '#title' => t('CNPJ or CPF'),
  );

And that's it! You are done.

File

README.txt
View source
  1. This module adds 3 new widgets to the text field type at the Field UI.
  2. They are:
  3. CPF - Accepts only valid tax number of individuals
  4. CNPJ - Accepts only valid tax number of companies
  5. CPF / CNPJ - Accepts either one as long as it is a valid number
  6. Learn more about these Brazilian tax numbers at wikipedia:
  7. CPF and CNPJ
  8. The view format display are done as followed:
  9. CPF - 999.999.999-99
  10. CNPJ - 99.999.999/9999-99
  11. This module also adds 3 new field types for the Form API.
  12. They are:
  13. number_cpf, number_cnpj and number_cnpj_cpf
  14. So, developers can easily build form elements of Brazilian Tax Number types.
  15. For example:
  16. $form['my_cpf_field'] = array(
  17. '#type' => 'number_cpf',
  18. '#title' => t('CPF'),
  19. );
  20. $form['my_cnpj_field'] = array(
  21. '#type' => 'number_cnpj',
  22. '#title' => t('CNPJ'),
  23. );
  24. $form['my_cnpj_cpf_field'] = array(
  25. '#type' => 'number_cnpj_cpf',
  26. '#title' => t('CNPJ or CPF'),
  27. );
  28. And that's it! You are done.