Creation of new content type by D7 core is intuitive, fast and nice looking. We don't have to worry about db tables and simple validation. We have widgets, displays, etc. And actually we are building a form (company_node_form).
Example:
Custom content type: Company
Field group: Company address (vertical tab)
- Field (simple text): Street
- Field (simple text): No.
- Field (simple text): Zip code
- Field (simple text): Country
Field group: Company contact (vertical tab)
- Field (check box): Has phone
- Field (simple text): Phone
- Field (check box): Has fax
- Field (simple text): Fax
Field group: Privacy (vertical tab)
- Field (check box): Show address
- Field (check box): Show phone
Question
How to add alternation using custom module "my_module" to provide AJAX behavior while adding or editing content type, i.e. to show "Phone" field only if "Has phone" is checked or show text "Sorry, we don't have authority to add companies from selected country." when UK goes to "Coutry" field?
Exclamation
I know that the above form is very simple to code inside my_module, but I wish to use core node constructor to build that form instead of coding.