I'm trying to capture n value in order to use it inside a loop, like this:
test.php
<!DOCTYPE html>
<html>
    <head>
        <script>
            function store(val) {
                var n = val;
            }
        </script>
    </head>
    <body>
        <form>  
            <select onchange="store(this.value)">
                <option value='10'>abc</option>
                <option value='20'>def</option>
            </select>
        </form>
        <div>
            <?php
                for ($i = 0; $i < **?? n ??** ; $i++) {
                    echo '<input type="radio">';
                }
            ?>
        </div>
    </body>
</html>
If abc is selected, create 10 radio buttons; in case of def, 20. Would it be possible in this case? I've tried many examples but they didn't work so far. Any help? Thanks!
 
    