Show a required textfield when user select only ups shipping service on checkout form I am using drupal commerce for my client ecommerce site. For shipping methods I am using commerce_shipping, commerce_ups, commerce_usps.

Everything is working but my client wants when a user select any ups shipping service a textbox should be shown and should be required.

What I have done till now :

I have created a pane which contains a textbox using order setting. And that taexbox is showing on checkout form . But when I make this textbox as a required field than it is not possible to submit the form when user select usps or flat rate shipping services.

So how I can show a textfield on checkout form which should be required only when user select any ups shippping service.

Thanks!
You could try to do this via #states property in form API.

More information about that can be found here:
How to make a form required with states?

Personally i only used it to hide/display form elements, but required/non-required should be possible as well.