• 0

Javascript


Question

<form name="q1">
<input type="text" name="a1">
</form>
<script>
document.q1.a1.onKeyUp = function(){document.write('bla')};
</script>

This code does not work for some reason (and I really want it to because it will save me a LOT of work on the website and will drastically reduce the size of the final product)

The on key up function works as inline HTML, but does not work for some reason in the script above. How can I / is it possible to fix the problem?

Thanks!

-Ian

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Why don't you just put the script in the head like this:

<head>
<script language=javascript>
   function changetobla() {
	 document.write('bla')
	  };	   
	</script>
 </head>

Then have the TextBox use the onKeyUp property:

<form name="q1"><BR>
	<input type="text" name="a1" onkeyup=changetobla()><BR>
</form><BR>

I mean, all that does is as soon as you let go of the key, replaced the textbox with a BLA, but I'm not sure what you are doing, hope that helps.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.