Macromedia® DreamWeaver® MX Unleashed By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter 6. HTML Forms
In the Dreamweaver classes that I teach, students often ask how they can get a blinking cursor to appear automatically in the form. You have to use JavaScript, but the process is a simple one. Suppose you wanted a blinking cursor to appear in the first text field of the form_design.html. The important thing is to know the name of the text field and to know the name of the form. Highlight each of them to get their names in the Properties Inspector. To set the focus, follow these steps:
You need to write a JavaScript that looks like this: window.document. formname.fieldname.focus(). In the next step, you'll do just that. You'll place the script in the proper location within the HTML and swap the form name and field name attributes with the actual names found within this form.
Click in the code and design view to view both the code source and the design, as shown in Figure 6.25. In the body tag, after the background attribute, type in the JavaScript after an onload command. When all is said and done the <body> tag should look like this: