How to make a field required using JavaScript injector I have a field that is part of a content type that I need to make required by using a JavaScript injector.  The reason that I can't just make it required while setting the rules for that field is because I have to parse a string that will display on the same page whether or not I need to make it required.  Any thoughts?
Matt -

I would recommend looking into hook_node_validate(). This is a function hook provided by Drupal core that allows you to add custom validation into the form. While you cannot select "required" from the field UI, perhaps you can validate it here and then return an error if the form doesn't provide the correct information for that specific field.

Other things to investigate: hook_form_alter() and hook_validate - where you can add custom validation functions into the Drupal form array itself.

Helpful links:
https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_validate/7

https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7