SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1875 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"

The buttons respond only to
onClick events and cannot pass any particular properties of their own, such as value or name.
Command buttons are used extensively in the Character Entities object shown in Figure 1-6. (The object
was developed before Dreamweaver??™s Other Characters object was created.) Each character entity is a separate
Command button, written in the following form:
onClick=???getChar(???¡??™,??™¡??™)???>
NOTE NOTE
BC 17
Creating and Using Objects
FIGURE 1-6
This custom Character Entities object uses 96 separate Command buttons.
Each character entity symbol in each line has a specific purpose. The value is the character displayed on the
button; the first argument in the getChar() function is written to a hidden field and eventually sent to the
Web page; and the second argument is used to display the selected character in a text box:
function getChar(val,val2) {
document.theForm.charValue.value=val
document.theForm.txChar.value=val2
}
When this object is at work, the user makes a selection and clicks OK, and the objectTag() function
reads the value from the hidden field and writes it into the Web page:
function objectTag() {
return document.theForm.charValue.value;
}
Command buttons can be used to fire any custom JavaScripts and pass any necessary information to be
processed eventually by the objectTag() function.


Pages:
1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887