Here’s a simple example: http://codepen.io/shawkdsn/pen/HCfxi
Instead of buttons I opted for a
<select> element and (in this simplified example) two
<option> elements. Each option elements’ value is the URL you want to load into the
switchIframeSrc simply sets the
src attribute of the iframe to the selected option’s value (the URL.)
I read through your other thread and I believe there’s a better solution to your problem, but I would need more information to determine exactly what that is. Forms can be tricky.