Javascript:The user interacting is through objects for data entry (text), dialing options (radio, checkbox and combo), buttons and links to other pages. See following a summary of each of these objects events.
JAVASCRIPT OBJECT INPUT TEXT
The events associated with this object are: onchange, onblur, onfocus and onselect.
<form name = “TText”>
<p> Text Input <input type = text size = 20 maxlength = 30
name = “CxTexto” value = “” onchange = “alert (‘You entered’ +
CxTexto.value) “>
</ p>
</ form>
JAVASCRIPT OBJECT INPUT PASSWORD
The events associated with this object are: onchange, onblur, onfocus and onselect.
<form name = “TPassword”>
<p> Password input <input type = password size = 10
maxlength = 10 name = “password” value = “”>
</ p>
</ form>
JAVASCRIPT OBJECT CHECKBOX INPUT AND RADIO
The only event associated with these objects is onclick.
<p> Radio </ p>
<p> <input type = radio name = “Rad” value = “1”
onclick = “document.bgColor = ‘green'”> Green Fund
<input type = radio name = “Rad” value = “2”
onclick = “document.bgColor = ‘blueviolet'”> Violet Background
<input type = radio name = “Rad” value = “3”
onclick = “document.bgColor = ‘# FFFF00′”> Yellow Background
</ p>
JAVASCRIPT OBJECT INPUT BUTTON
This object aims to create a button to which to peg logic operations to be performed when it is clicked. The only event associated with this object is onclick.
<p>
<form method = “POST” name = “TstButton”>
Enter a text <input type = text size = 30 maxlength = 30
name = “test” value = “”>
</ p> <p>
Click the button <input type = button name = “Btest” value = “Button
of test”
onclick = “alert (‘You entered’ + TstButton.Test.value)”>
</ p>
</ form>
JAVASCRIPT OBJECT INPUT SUBMIT
This object is a button which aims to submit (send) the contents of the form to the server objects. The only event associated with this object is onclick.
JAVASCRIPT OBJECT TEXTAREA
The events associated with this object are: onchange, onblur, onfocus and onselect.
JAVASCRIPT SELECT OBJECT
To use this object, it is important knowledge of other associated properties:
- Object.length: Returns the number of existing options in the list;
- Object.selectedindex: Returns the “index” of the selected object (first = 0);
- Object.options [index] .text: returns the external text associated with each option;
- Object.options [index] .value: Returns the internal text (value) associated with each option;
- Object.options [index] .selected: returns true or false.
The events associated with this object are: onchange, onblur and onfocus.
Finally, one of the most common objects in Javascript in interaction are the windows. To start working with windows, the general syntax is as follows:
Variable = window.open (“Url”, “Window Name”, “Options”)
- Variable – name that will be assigned as property of the window.
- Url – Internet address where the window opens. Normally uses up its own Url.
- Window name – is the name that will appear in the window’s top (title)
- Options – These are the options that define the window features, such as:
the toolbar – Creates a type of toolbar “Back”, “Forward”, etc;
the location – Open the browser’s location bar;
the directories – Open the toolbar type “What’s New”, “Handbook”, etc;
status – Opens a status bar in the bottom window;
the scrollbars – Opens vertical and horizontal scroll bars;
the menubar – Creates a menu bar type “File”, “Edit”, etc;
the resizable – Allows the user to resize the window;
the width – Specifies the width of the window in pixels;
the height – Specifies the window height in pixels.
All options (except width and height) are Boolean and can be set in two ways.
Example: “toolbar” or “toolbar = 1” are the same thing. If nothing is specified, it is understood that all options are linked; If you specify any option, it will be understood that it is connected only to informed choices. The Options are given separated by commas with no spaces between them.
Visit our blog and check out more content!
You might also like…