I am new to javascript and I can't populate many fields with one click.
<script>
function addTxt(txt, field)
{
var myTxt = txt;
var id = field;
document.getElementById(id).value = myTxt;
}
</script>
<input type="text" name="xx" id="info" autofocus="required">
<p><a href="#" onclick="addTxt('x', 'info')">x</a></p>
I've got 3 more fields.
Thanks.
<a>with a<button>or somethinfunction addTxt(txt, id){ document.getElementById(id).value = txt; }. There's no need to copy arguments to new local variables.<a>with<button onclick="addTxt('x', 'info')" type="button">X</button>and you can format it to look like anything in the world with CSS