You do not create decisions on the fly. You pre-create the possible conditions that the user may choose.
What you want to do there is quite advanced and I think you should have few basic tutorials in Javascript first.
But to elaborate and expand on your idea, writing <input> or other HTML elements using Javascript is not really recommended. What you should do is have a script that can hide/show <div> or <p> block elements. Then place the inputs in the block elements and set their style to display:none. Then you can start using the events (onClick, onFocus, onBlur etc) to fire/initiate functions:
<p><input type="radio" id="radio1" onClick="myFunction();"></p>
<p id="hiddenElement1" style="display:none;"><input type="text" name="name" /></p>
<script type="text/javascript">
function myFunction(){
var rd = document.getElementById('radio1');
if(rd.checked){
document.getElementById('hiddenElement1').style.display = 'block';
};
};
</script>
Above is not tested, however it's just a basic idea of how you would write your code. However if you use "JQuery" javascript library, it will make your life 100% easier 