AJAX change field is required
You can use Form API #states attribute. This will allow you to trigger something based on another fields information. Below should be a working example.

$form['vin'] = array(
  '#type' =&gt; 'textfield',
  '#title' =&gt; t('VIN'),
  '#default_value' =&gt; '',
  '#states' =&gt; array(
    'required' =&gt; array(
      ':input[name="ask_required"]' =&gt; array('checked' =&gt; TRUE),
    ),
  ),
);