Probably, you want the code to fire after the page has already loaded and after the user has clicked the drop-down box.
Probably, you want the number of forms to load onto the same page without refreshing the page?
In this case, you cannot use PHP -- it has already finished rendering the page. You need to use javascript (or, better yet, jQuery) in order to interact with the user.
If I understand correctly, the best solution is to use AJAX. Not to worry, it is actually super simple, especially when using jQuery.
Here are some simple examples for getting the basics of AJAX. Do not just review them -- copy the code, and try them yourself. Both jQuery and AJAX are much simpler than you may think.
A simple AJAX example
More complicated example
Populate dropdown 2 based on selection in dropdown 1
Note that you must load the jQuery library, usually in the <head>
tags like this:
<head>
<!-- other stuff in head -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
If you use a CDN to load jQuery, as in the above example, it is probably already be pre-loaded from other websites.
If you want some fast lessons on jQuery, find free video tuts here:
https://www.thenewboston.com/videos.php?cat=32
or at
http://phpacademy.org