I have two forms on my page, and I want to pass the data from one input field to another input field using javascript. If the radio input is checked in the first form, the input value should get this value.

My forms:

```
<form name="news-form" action="p" method="post">
            <section id="section-list" style="">            
                <hr class="solid">

                <?php
                    $text = "";
                    $headline = "";
                    $shortdescription = "";
                    $description = "";
                    $linktext = "";
                    $link = "";
                    $newsID = "";

                    $xml=simplexml_load_file($xmlurl)or die("Kann keine Verbindung zu $xmlurl aufbauen");

                    foreach($xml->children() as $news):
                    $newsID = $news->ID;
                ?>
                <div name="idsection" title ="<?php echo $newsID; ?>">
                <section>
                    <div class="divID">
                        <label class="label-idnumber">Eintrag Nummer: <?php echo $news->ID; ?> </label>
                        <input id="NewsID"  type="radio" name="NewsID" value="<?php echo $newsID; ?>"></input>
                    </div>
                </section>
                .
                .
                .
                .
                .
</form>

<form name="newsEntryBea-form" action="" method="post">
            <section id="section-bea" style="">         
                <hr class="solid">          

                <section>
                    <div style="float:left;">
                        <label for="idnumberBea" class="label-header">Eintrag Nummer</label>
                        <input id="idnumberBea" name="idnumberBea" type="text" value="" readonly> </input>
                    </div>
                </section>
                .
                .
                .
                .
                .
</form>

```

My script code:

```
<script>
    function inputToggle(e) {

        var sectionnumbers = document.getElementsByName('idsection');   
        var sectionnumber;  
        var idnumbers = document.getElementsByName('NewsID');
        var idnumber;

        for(var i = 0; i < idnumbers.length; i++){
            if(idnumbers[i].checked){
                idnumber = idnumbers[i].value;

                for(var i = 0; i < sectionnumbers.length; i++){
                    sectionnumber = sectionnumbers[i].title;

                    if(sectionnumber === idnumber){
                        document.getElementsByName('idnumberBea').value = idnumber;     
                        console.log("Mein Text im Feld idnumberBea: " + document.getElementsByName('idnumberBea').value);
                    }
                }                               
                console.log("Meine NewsID Nummer: " + idnumber);
            }
        }
    }
</script>

```

So in the console I get all my values correctly shown, but in the HTML form the value is not displayed.

Can anybody tell what is wrong here?