bookmark - Fun With Javascript And Forms Lets have some fun with javascript!

Fun With Javascript And Forms - Lets have some fun with javascript!

 
 Discussion by Aldo with 2 Replies.
 Last Update: January 8, 2008, 3:20 pm
 
bookmark - Fun With Javascript And Forms Lets have some fun with javascript!  
    
free web hosting
 
I will post here every week with new and exciting things to do in javascript!
After i finish 10 of them , ill do Ajax(real-time)
-
1.Alerting and documenting Forms
Ever seen those dynamic sites where if you hove your mouse or type something bad..etc , it popups up or dynamically gets written onto the page? Well i am here to teach or rather help with all that stuff!

Step 1:Get notepad out and make a form

CODE

<form name='test'>
<input type='text' name='field1'>
Text displays here:
<div id='r'>


</div>


Step 2:
Add the javascript Bit

CODE

<script type="text/javascript">
function onKeyDown() {
document.GetElementById('r').innerHTML=document.test.field1.value;
}
</script>


Step 3 :CONCLUSION
We join both of them

CODE

<script type="text/javascript">
function onKeyDown() {
document.GetElementById('r').innerHTML=document.test.field1.value;
}
</script>
<form name='test'>
<input type='text' onKeyDown='onKeyDown()' name='field1'>
Text displays here:
<div id='r'>


</div>



Result:
Suppose you type Astahost, letter by letter, tehn in that div area, it will come letter by letter too.
A
A
As
As
Ast
Ast
like that

Hope this helped!
Will get a good one next time~

Thu Nov 22, 2007    Reply    New Discussion   


QUOTE (Aldo)

I will post here every week with new and exciting things to do in javascript!
After i finish 10 of them , ill do Ajax(real-time)
-
1.Alerting and documenting Forms
Ever seen those dynamic sites where if you hove your mouse or type something bad..etc , it popups up or dynamically gets written onto the page? Well i am here to teach or rather help with all that stuff!

Step 1:Get notepad out and make a form

CODE

<form name='test'>
<input type='text' name='field1'>
Text displays here:
<div id='r'>
</div>


Step 2:
Add the javascript Bit

CODE

&lt;script type="text/javascript">
function onKeyDown() {
document.GetElementById('r').innerHTML=document.test.field1.value;
}
</script>


Step 3 :CONCLUSION
We join both of them

CODE

&lt;script type="text/javascript">
function onKeyDown() {
document.GetElementById('r').innerHTML=document.test.field1.value;
}
</script>
<form name='test'>
<input type='text' onKeyDown='onKeyDown()' name='field1'>
Text displays here:
<div id='r'>
</div>

Result:
Suppose you type Astahost, letter by letter, tehn in that div area, it will come letter by letter too.
A
A
As
As
Ast
Ast
like that

Hope this helped!
Will get a good one next time~
Link: view Post: 114334

Thanks, i think that i would use it in my last project.

BTW, i hope that you post soon all the other stuff not in 9 weeks :rolleyes:

Best regards,

Sun Nov 25, 2007    Reply    New Discussion   

Hi, it would be interesting to see those tutorials.
Go ahead

Tue Jan 8, 2008    Reply    New Discussion   

Quickly Post to Fun With Javascript And Forms Lets have some fun with javascript! w/o signup Share Info about Fun With Javascript And Forms Lets have some fun with javascript! using Facebook, Twitter etc. email your friend about Fun With Javascript And Forms Lets have some fun with javascript! Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print

Adding Element To Page Issues   Adding Element To Page Issues (0) (6) Copy To Clipboard Function   Copy To Clipboard Function