Show html with input fields

I want to do A/B split testing within a single html page. I guess something like:

50% of the time show this html - and 50% of the time show this html.

However they are input fields with validation so I am thing if I were to do some kind of jQuery hide then the submit button wouldn’t work. Any ideas on how to accomplish this?

Thanks

Why can’t there be two forms, each having their own submit button?

I want to reuse the same code so they are essentially the same, but one needs to be hidden. Its not my code, I only have access to change the look CSS.

Is there a way to accomplish this?