Click to See Complete Forum and Search --> : textbox to var???


gs_pistola
08-08-2003, 09:55 AM
Hey again, How can i get information from a input text into a var in the js code? I've done an hours worth of research on this. is it possible? I tried the prompt but it was a pain. I'd rather have a text box =D

Charles
08-08-2003, 10:05 AM
<input type="text" onchange="window.someVariable = this.value">

Or you could go the other direction:

<input type="text" id="foo">

<script type="text/javascript">
someVariable = document.getElementById('foo').value;
</script>