Auto updating header?

42 views Asked by At

I'm currently doing work experience designing the ui for some courier software in basic HTML. I have only been doing this for 4 days now so please excuse my basic knowledge etc.

At the top of this particular page I have 2 headers which I would like, if possible, to get to automatically update to mirror data entered into 2 fields lower in the form. Neither of these fields has a submit button currently and ideally I would like it so that the headers are changed when the user clicks on the next part of the form. My boss didn't know how to do this but suggested I look at java onchange commands, however I haven't been able to find anything that would help me out in this regard.If anyone has any suggestions they would be greatly appreciated.

1

There are 1 answers

1
Hidde On BEST ANSWER
<script type="text/javascript">
function changed () {
    var el = document.getElementById('info');
    el.innerHTML = document.getElementById('user').value;
}
</script>
<form name="log in_form" method="post" action="log.php?action=login">
            <div class="forminput"><input onkeyup="changed()" type="text" id="user">
        </form>

        <div id="info">

        </div>

Use the onKeyUp, for constant updating.