We created the the first page (the form, named "formtest.php") in Dreamweaver and used the point-and-click Design view interface to create the form (no coding needed). See form layout below:

Be sure to set the properties for various items as well as detailed below:
- To create the form (the form is indicated by the red dotted line), click Insert >> form >> form.
- Accept form1 as the name of the form; set the "action" of the form to be formdisplay.php
- Set the method to "GET." (see picture below)

- To insert the name field, click Insert >> Form >> Text Field. Set "Name" to "name," "Char Width" to 25 and "Max Chars" to 50. Be sure to put the text field INSIDE the form, i.e, the red dotted line.
- Insert the submit button: Click Insert >> Form >> Button. Accept the default name, etc. and press OK.
- Insert the reset button: Click Insert >> Form >> Button. Accept the defaults. Change the "action" for the button to "Reset form."
- Save the page.

To test the code, open formtest.php on our class webserver, type a name, and press submit. The name should display on the page called "formdisplay.php."

No comments:
Post a Comment
Note: Only a member of this blog may post a comment.