If you want to submit the wrong form to the server, you can include a variable that would trigger a routine to return a right form with the desired number of fields.
If you want this to happen on the user's browser -- that is, to change the wrong form into a right form BEFORE submitting to the server -- which my guess is what you want, you need javascript, a browser scripting language. There are many javascript sites with code snippets that do this exact thing in a variety of ways.