How do I place a Javascript varible into a form input value?

They have: 5,633 posts

Joined: Jan 1970

I need to place a JS variable into a form input value... How do I do this?

Thanks!

They have: 8 posts

Joined: Nov 2001

here is a small example...

<script>
var val = "hello";
document.myform.myinput.value = val;
</script>

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.