I try to make some inputs to be completed according the input from the textfield `value_master`.
For instance, if I type `123` in the textfield `value_master` I want to have a specific text in every `value_slave` field, but if I type `223` I want something else.

I managed to this and is working without the if conditions. With that I get this: `slave.substring is not a function`. Is important to use substring because I will have more fileds to be completed based on specific position of master value.

```
    window.onload = function()
    {
        var master = document.getElementById('value_master');
        var slave = document.getElementById('value_slave');

        document.getElementById('value_master').onkeyup = function(){
            if (slave.substring(0,1).equals("1") )          
            {
                slave.value = 'you typed something starting with 1';
            }
            else {
                slave.value = 'you typed something starting with 2';
            }
        };
    };

```