Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Fun With Javascript And Forms, Lets have some fun with javascript!
Aldo
post Nov 22 2007, 10:21 AM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Banned
Posts: 7
Joined: 22-November 07
Member No.: 26,356



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~
Go to the top of the page
 
+Quote Post
TavoxPeru
post Nov 25 2007, 01:26 AM
Post #2


Super Member
Group Icon

Group: [HOSTED]
Posts: 744
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



QUOTE(Aldo @ Nov 22 2007, 05:21 AM) *
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~

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 wink.gif

Best regards,
Go to the top of the page
 
+Quote Post
rraallvv
post Jan 8 2008, 03:20 PM
Post #3


Advanced Member
Group Icon

Group: Banned
Posts: 119
Joined: 2-January 08
Member No.: 27,304



Hi, it would be interesting to see those tutorials.
Go ahead
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Getting Screen Resolution using Javascript.(8)
  2. How To Create A Popup Window With Javascript?(19)
  3. javascript vs java(12)
  4. Javascript: Disable Mouse Right-click In Browser(16)
  5. Best Way To Learn Javascript(9)
  6. Javascript: Text To Texbox And Back To Text(2)
  7. Unobtrusive Javascript Image Rollovers(0)
  8. Dynamicdrive: Good Site For JavaScript Codes(5)
  9. Downloads With Javascript?(7)
  10. Javascript: Simple Slidedown Menu(2)
  11. JavaScript: Simple Dropdown Menu(1)
  12. Calling Of Functions Between Mulitple External Javascript Files(2)
  13. Javascript: Browser Detection Script(0)
  14. JavaScript: Hide And Show Any Element With CSS(5)
  15. Ever Needs To Find Out A Table Height Or With With JavaScript(2)
  1. Create And Import JavaScript Modules For A Large Script(2)
  2. Vertical Marquee Using JavaScript(0)
  3. JavaScript Frames & Querystring(4)
  4. JavaScript Off Redirect Script(2)
  5. I Need Help With Javascript.(7)
  6. Problems With Dynamically Loading Javascript(2)
  7. Add Text To Textarea(6)
  8. Javascript Question(4)
  9. Javascript: How Do I Create Embedded Pop-up Windows?(7)
  10. Problem With Javascript Alert();(9)
  11. Include Function For Javascript(7)
  12. Javascript Help Needed : Alert(z) Works Fine But Document.write Not(2)
  13. Javascript Changes Aren't Working.(6)


 



- Lo-Fi Version Time is now: 30th August 2008 - 04:11 AM