How to Get Content in text field dynamically, based on dropdown selection in php

The way I would do this is to use JavaScript, trigger a function when the user selected the university from the first drop-down, have that function call a separate bit of PHP code to retrieve all the departments for that university and stick them in the second drop-down.

If you have a search down the forum, I put some sample code in another thread. ETA this one: How to auto-fill 2 drop-down and text-box based upon on the first drop-down value selected? - #7 by droopsnoot

The down-side of this is that if you have to deal with users that have JavaScript switched off, that approach won’t work.