iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • Pass the Javascript, please...
    123,738

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Change a Form Field with Javascript

    Change a Form Field with Javascript



    To change a form field with Javascript:

    function sayHey() {
    fo.el.value="Fill it in, dog!";
    }

    <FORM name=fo>
    <input type=text name=el>
    </FORM>

    <a href="#" onMouseOver="javascript:sayHey()">Mouse Over Me, Please</a>


    First, I'll explain our FORM:
    -We named our form fo because we like short names.
    -We named our text field el because we like easy to type names.

    Next, I'll explain our function:
    -We created a function and named it sayHey().
    ---the first section needs the form name which we named fo
    ---the second section needs the form element name which we named el
    ---the third section is the word value which means we are about to say what we want fo.el to equal.

    Lastly:
    -We created a link and used onMouseOver to call our function.


    When we onMouseOver, the text field will fill with our text "Fill it in, dog!".


    Free Copy and Paste Javascript Code:

    <script type="text/javascript">
    <!--

    function sayHey() {
    fo.el.value="Fill it in, dog!";
    }

    -->
    </script>


    <form name=fo>
    <input type=text name=el>
    </form>

    <a href="#" onMouseOver="javascript:sayHey()">Mouse Over Me, Please</a>


    Resources:
    Use OnMouseOver in Javascript
    Create a Function in Javascript
    Call your Function in Javascript


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Use onMouseOut in Javascript
    Next Article: Use onLoad in Body Tag with Javascript





    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Head First HTML with CSS...Head First HTML with CSS & XHTML

    Eric Freeman, Elis...

    New $23.99

    CSSCSS

    David McFarland

    New $23.09

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $23.99

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39


    Of Interest:
  • Write a FOREACH LOOP in Perl
  • Matching at the Beginning and End
  • OPEN and WRITE a Data File in Perl
  • Delete a File Using unlink in Perl
  • Use onMouseOut in Javascript
  • Javascript Italics Text
  • Annoy Users with onBlur in Javascript
  • Use onClick in Javascript
  • HTML Color Codes
  • HTML Forms
  • HTML Tags
  • Make Strikethrough Text Using HTML

  • More Articles:
  • To See if a Directory Exists in Perl
  • And, Or, Equal, Not Equal, Greater Than, Less Than in Perl
  • Putting Two Strings Together, Concatenate
  • Check for Existing File in Perl
  • onClick Javascript
  • If, Else If, and Else in Javascript
  • Use onLoad to Call More than One Function with Javascript
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Reading Cookies using Javascript
  • HTML Color Codes
  • HTML Image
  • HTML Font Code
  • HTML Background

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    420,499
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:12 EDT