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

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > JavaScript

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

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
<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~

 

 

 


Reply

TavoxPeru
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,

 

 

 


Reply

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

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. javascript verify forms square brackets - 92.88 hr back. (2)
Similar Topics

Keywords : fun, javascript, forms, lets, fun, javascript

  1. Web Editor
    great application for your html and javascript development (0)
  2. Conditional Statements Of Javascript
    Tutorial for beginers (1)
    In this tutorial we will discuss about conditional statements of JavaScript. JavaScript has 4 types
    of conditional statements such as if statement, if...else statement, if...else if....else statement
    and switch statement. All this statements are used in different condition. Now we will try to
    discuss this 4 types of statements with some examples. When we need to execute some code only in a
    specified condition, then we will use if statement. The syntax of if statement is if (condition) {
    code to be executed if condition is true } One important thing is that this if will....
  3. Javascript Operators
    (0)
    In this part of the tutorial, we will discuss about JavaScript Arithmetic Operators, JavaScript
    Assignment Operators, Comparison Operators, Logical operators and conditional operator. +, -, *, /
    etc are the JavaScript Arithmetic Operators. =, +=, -= etc are the JavaScript Assignment Operators.
    ==, != etc are the Comparison Operators and “&&”, “||” etc are the
    Logical operators. Arithmetic operators are used to perform arithmetic between variables and/or
    values and Assignment operators are used to assign values to JavaScript variables. Comparis....
  4. Javascript Tutorial For Beginner
    Using Javascript in HTML page (0)
    In this tutorial I will show you how you can put JavaScript in a HTML page. It is very easy to add
    JavaScript in a HTML page. We will use <script> tag for this purpose. Inside the <script>
    tag, we will use "type=" attribute and will define the scripting language. We will define the script
    language as “text/javascript”. After define the script language we will add our
    JavaScript codes and at last we will close the tag using . So the complete code will be- CODE
    <html> <body> <script type="text/javascript"> (Pla....
  5. Javascript Changes Aren't Working.
    (6)
    The link is where I got it from, the code is my attempt at changing it, which has the identical
    javascript, but it doesn't work. Can anyone fix it for me?
    http://code.google.com/edu/client/samples/dhtmltest.html CODE <!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1.1.dtd">
    <html
    xmlns="http://www.w3.org/1999/xhtml"><head><title>example</title
    ><style type="text/css"> body {font: 14px arial; color: #000066;}
    #mytext {posit....
  6. Javascript Xml Parser Vs. Xslt Processor
    ...which is better on your opinion? (0)
    Web application data (taken directly from data storage or created in the middle tier) are often
    presented in XML format, which looks like an universal data format on server side. However, if we
    want to show such data in the browser, we need to transform them to HTML format. There are two
    concurrent ways of doing this transformation: - XSTL transformation on server side - XML parsing on
    client side I have not big experience in XSLT transformation, but I have found that is not good for
    performance (takes lot of server resources). May be, it make sense to use for differ....
  7. Javascript Help Needed : Alert(z) Works Fine But Document.write Not
    please (2)
    hi all, I am facing problem in my javascript, any kind of help would be apreciated CODE
    function basicFiles(){ //var Z = "";             for (i = 0; i <
    document.Form.regionlist.options.length; i++) {                 var x =
    document.Form.regionlist.options[i].value;                 var y =
    document.Form.regionlist.options[i].text;                 var Z =  "regions" +
    "[" + x + "]" + " = " + y + ", ";
                    alert(Z);             }                   } th....
  8. Javascript Problem
    (3)
    CODE text=new Array (
    "不要让我自己发帖哦,你也
    ;要多发主题啊!",
    "我们不是最大的犬中文站,
    ;但我们能做得更好!",
    "或许很多人都只是匆匆过客
    ;,但是这里仍然会愿意你留
    997....
  9. Include Function For Javascript
    (7)
    I've been working on an include function for javascript. It works just fine in Firefox and IE,
    but for some reason, it doesn't result in the loading of the scripts for Safari. The code is as
    follows: CODE function include(url) {   // Include Guard   var scripts =
    document.getElementsByTagName("script");   for (var index = 0; index <
    scripts.length; ++index) {     if (scripts.src == url) {       return;     }   }      //
    Inclusion   var head = document.getElementsByTagName("head").item(0);   ....
  10. Extplorer
    A PHP -and JavaScript- based File Manager (7)
    Browsing the ExtJS examples website i found this excellent web-based file manager called
    eXtplorer . eXtplorer allows you to browse your webserver folders with an intuitive Layout which
    makes working with files very easy, and thanks to the great ExtJS Javascript Library you can drag
    & drop folders and files, filter directories and sort the file list using various criteria. You can
    use eXtplorer to for example: browse directories & files on the server. edit, copy, move, delete
    files. search, upload and download files. create and extract archives. create new fil....
  11. Add Text To Textarea
    I suppose it uses DOM and JavaScript?? (6)
    I am working on a web "application" thing that allows you to click a button to add text to a
    textarea. Similar to this forum when you click the BOLD button and it puts in {b}{/b} with the
    square brackets. I want a similar function like that. Also, I want it to add wherever the cursor is,
    not at the end. And after adding the thing, the cursor should be in between the tag or whatever that
    was added. All the extra stuff are extra priorities. For now I would like to get something that
    inserts text on click. The thing I came up with is: HTML html > head > <script ....
  12. I Need Help With Javascript.
    help plz (7)
    Well, I want to learn to code in JavaScript, but when I try to view the page in Firefox, it
    dosen't work. Can anyone tell me why its not working? Do i need to use a different browser?....
  13. JavaScript Frames & Querystring
    (4)
    Hi, I actually want to create a HTML page which has the capablity of reading a QueryString
    (x.html?querystring=test) and then using a hidden frame pass on the data to an ASP Script on another
    server. For obtaining the QueryString i use the following:- CODE <script> function
    getQueryVariable(variable) {   var query = window.location.search.substring(1);
      var vars = query.split("&");   for (var i=0;i<vars.length;i++) {
        var pair = vars[i].split("=");     if (pair[0] == variabl....
  14. Create And Import JavaScript Modules For A Large Script
    (2)
    I have one main script which defines an object. I then have several other script files that define
    functions for that object. I have tried using the following setup to import the functions: HTML
    code snippet: <script type="text/javascript" src="/foo/mainbar.js"> <script
    type="text/javascript" src="/foo/modulebar.js"> Javascript code snippet: import
    Object.functionName; This works fine for Mozilla Firefox, but causes an error in Internet Explorer
    which causes the object to be undefined. I would like to know how better to import the functions
    into the m....
  15. Ever Needs To Find Out A Table Height Or With With JavaScript
    Well stop looking, here is the answer (CSS and JS) (2)
    Welcome everybody to this litle tutorial. by v.DragonEyE.n09 Introduction: Using
    javascript you can find the height and width of a table, cell, div, image, etc.. the more simple way
    is to ask for this... QUOTE id= "myElement" border= "0" cellpadding=
    "0" cellspacing= "0" style= " height : 300px ; width
    : 450px ; " > some
    fake text and images for the example some fak....
  16. JavaScript: Hide And Show Any Element With CSS
    From the simple way to the more advanced way (Javascript & CSS) (5)
    Welcome everyone, this is my first post. The first thing you need to know is... CSS
    has two special attributes, the first one is " display " and the second is " visibility ". The
    difference between these two goes like this. " display ": has many properties or values, but the
    ones we need are "none" and "block". "none" is like a hide value, and "block" is like show. If you
    use the "none" value you will totally hide what ever html tag you have applied this css style. If
    you use "block" you will see the html tag and it's content. very simple. " visibi....
  17. New Features In Visual Studio 2005 Windows Forms
    (1)
    i dunno if all of u are by now well versed with the new exciting features in visual studio 2005
    forms, but for me this article was enlightening. for the benifit of others who wre in the dark like
    me.... New Features in Visual Studio 2005 Windows Forms QUOTE The little voice in my head
    shouted "Don't do it! Don't do it!" as I contemplated using the worn out cliché
    "Good things come to those who wait" to describe the experience of designing Windows applications
    with Visual Studio 2005. However, that cliché accurately communicates the idea that bui....
  18. Javascript: Text To Texbox And Back To Text
    (2)
    i need some help i want to create a thing where when some one double clicks a certain text it
    changes into a texbox where they can edit the text and the they double click and it changes into the
    test they just typed in. I have found this function in javascript that does some of it but i needs
    to be simplified CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html> <head> <title>Span to Text Box - Demo - DOM</title> <scr....
  19. Best Way To Learn Javascript
    I would very much like to know. (9)
    Well, I know HTML, I know CSS, so the next step is learning Javascript. I have heard that it is sort
    of an easier way to do things than PHP, though I would very much like to learn PHP as well. So, I
    thought that if I learnt Javascript, I might find it easier to learn PHP when I get to that point.
    The problem though is actually finding out the best way to learn Javascript. I have been to
    websites and things, but every time I read through the tutorials and articles and things, I
    didn't learn anything. It when in one ear and out the other, you could say. So, that is wh....
  20. Lets Talk: Free Cell Phone Company Not So "free"
    (12)
    I just recently got a Motorola V3 RAZR cell phone from http://www.letstalk.com . The price tag
    said, "Free." Let me warn you, it really wasn't free. You have to pay for the phone and then
    they give you rebates and stuff, which then equals free. But by signing up for a free cell phone
    from that company, it constitutes agreement in paying for a yearly contract for your cell phone to
    be able to call people. So I scored a deal, they get paid by the phone distributor, the phone
    company (mine's T-Mobile) gets the money, everyone wins! One thing though, their custo....
  21. Hack Websites
    using a simple javascript (8)
    Sometimes, I come across websites that are very annoying, like webpages which play embedded music
    files or excessive animations. Seems that people who encouter such websites like me have a solution
    is you use Firefox. Just use an extension and you can hack and alter these websites and
    webpages! According to Wired (http://www.wired.com/wired/archive/13.09/start.html?pg=7):
    QUOTE Remix culture has hit the browser. Just as you can pimp your Scion with snap-on parts, you
    can modify Web sites to suit your tastes - whether the authors like it or not. The enabling tec....
  22. Creating Tooltips
    DHTML, HTML, CSS, Javascript... (7)
    Here is a little tutorial to make those small yellow-background boxes (tootltips) that pop-up for
    some links that describe them when you hover the mouse over them, it uses DHTML, CSS, HTML, and
    Javascript, so it gives us a much more wide range than my previous tutorials that just where on
    HTML. OK, so here we go... Put this right under CODE <div
    id="dhtmltooltip"></div> <script type="text/javascript"> var
    offsetxpoint=-60 //Customize x offset of tooltip var offsetypoint=20 //Customize y offset of tooltip
    var ie=document.all....
  23. Random Images On Eacht Pageload And Refresh.
    best in plain htlm or javascript (6)
    Im looking for somethin that puts a diffrent image for each pageload/refresh. And it should be
    something that dosent need any super server technolgys like php and mysql and all that stuff.
    something that is enough just on the page and finished.....
  24. Switching Forms - VB.NET
    Some VB.NET Basics (2)
    When I started coding in VB.NET I was unsure of how to switch forms at a click of a button or any
    other event. So for anyone with the same problem this is for them. First you must have at least two
    forms in the project. If you do not know how to add forms to a project heres how: 1) Under the
    "Project" Menu select "Add Windows Form..." 2) In the dialog box that pops up near the bottom you
    will see "Name:" with a textbox beside it. In the text box type the name of the new form. For this
    example we will just use the default name, "Form2.vb" 3) Click "Open" You now have....
  25. How To: VB.NET Pop-up Docking Forms
    (1)
    Background I recently had the need to add a few panels to a program that I have been working on.
    The panels did not need to be shown all the time and I didn't want to spawn a new form everytime
    I needed to see the extra panel. Additionally, I wanted the new panels to dock to the side of the
    main form so they would not cover the main content. My program needed three seperate areas, a debug
    window, options window, and of course the main window as shown in Figure 2. Figure 1 After quite
    a bit of experimenting I decided to show/hide forms that were loaded with ....
  26. Let's Talk " Commercial Arts Vs. Fine Arts
    (13)
    Commercial Arts : Narrative Informative Purposeful Communication Target Oriented (audience)
    Problem soving Rationale Time concern Finr Arts : Abstract Imagination Personal interset Self
    expression Inspiration driven Exporing Freely No time constraint And I think , design concepts and
    priniciples provide a basic guideline in organizing various design elements or aspects , say line .
    space , color , form , type , and image into a beautiful visual composition.....
  27. Javascript: Disable Mouse Right-click In Browser
    (16)
    just copy and paste this on to your html site in the head tag CODE <script
    language="JavaScript"> <!-- /* */ var message="Hey YOU!\nStop
    Stealing my pictures or\nFACE THE PUNISHMENT!" function click(e) { if
    (document.all) { if (event.button == 2) { alert(message); return false; } }
    if (document.layers) { if (e.which == 3) { alert(message); return false; } }
    } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } document.onmouse....
  28. javascript vs java
    (12)
    in my opinion javascript is better then java becasue java requires more programing experecense
    then javascript and i think to that javascript is more reliable then java in some ways....
  29. How To Create A Popup Window With Javascript?
    (19)
    Please help me! I want to in popup massage suggest to visitors of my site to make my site their
    home page . Please note that I have some script code that visitors most click on a text to make my
    site their home page . Every one that can help me please send an email to soleimanian@noavar.com....
  30. Getting Screen Resolution using Javascript.
    (8)
    Is it possible to get the screen resolution of the users moniter using only javascript. No other
    external stuff, just pure javascript. I guess most of the people using JAVA for this. I also got
    some scripts regarding this which used SCREEN.WIDTH function or something, but they did not seem to
    work out. Any possible solutions. BTW, is it possible to get the resolution using PHP ( I guess it
    is not ) .......

    1. Looking for fun, javascript, forms, lets, fun, javascript

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for fun, javascript, forms, lets, fun, javascript
Similar
Web Editor - great application for your html and javascript development
Conditional Statements Of Javascript - Tutorial for beginers
Javascript Operators
Javascript Tutorial For Beginner - Using Javascript in HTML page
Javascript Changes Aren't Working.
Javascript Xml Parser Vs. Xslt Processor - ...which is better on your opinion?
Javascript Help Needed : Alert(z) Works Fine But Document.write Not - please
Javascript Problem
Include Function For Javascript
Extplorer - A PHP -and JavaScript- based File Manager
Add Text To Textarea - I suppose it uses DOM and JavaScript??
I Need Help With Javascript. - help plz
JavaScript Frames & Querystring
Create And Import JavaScript Modules For A Large Script
Ever Needs To Find Out A Table Height Or With With JavaScript - Well stop looking, here is the answer (CSS and JS)
JavaScript: Hide And Show Any Element With CSS - From the simple way to the more advanced way (Javascript & CSS)
New Features In Visual Studio 2005 Windows Forms
Javascript: Text To Texbox And Back To Text
Best Way To Learn Javascript - I would very much like to know.
Lets Talk: Free Cell Phone Company Not So "free"
Hack Websites - using a simple javascript
Creating Tooltips - DHTML, HTML, CSS, Javascript...
Random Images On Eacht Pageload And Refresh. - best in plain htlm or javascript
Switching Forms - VB.NET - Some VB.NET Basics
How To: VB.NET Pop-up Docking Forms
Let's Talk " Commercial Arts Vs. Fine Arts
Javascript: Disable Mouse Right-click In Browser
javascript vs java
How To Create A Popup Window With Javascript?
Getting Screen Resolution using Javascript.
advertisement




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



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE