Make a custom field render differently based on dropdown status menu

Hi,

Is there a way to make a custom field have a different HTML layout based on the status of a record?
I assume this must be done with PHP before the page has even loaded as I tried with javascript but it always showed the ‘{field.something.value}’ text.
Where would I write this php if statement for the invoices module?

Thanks

You would need to make customisations with PHP/AJAX to show results dependent on the option selected.