1 chapter 05: creating your form. what is a form? when you visit some websites you see a form. with...

19
1 Chapter 05: Creating Your Form

Upload: hilary-stewart

Post on 18-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

1

Chapter 05: Creating Your Form

Page 2: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

What is a Form?When you visit some websites you see a form. With this form, you are asked to complete, for example, your personal information, your credit card number, your interest, etc.Try to sign up for an email account, you will see the form.How do they create such a form?

Page 3: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

How to Create a Form?

The form tag goes in pair:<FORM> …</FORM>Sample:<FORM>

<INPUT TYPE=BUTTON VALUE=“Search”>

</FORM>

Page 4: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

How to Create a Form?

Sets up a container for a form tag. Within the <FORM> tags, you can place form input tags such as <INPUT>, <SELECT>, and <TEXTAREA>.

Sample:

Page 5: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

How to Create a Form?METHOD={POST,GET} Changes how form data is transmitted

to the form processor. When you use METHOD=GET, the form

data is given to the form processor in the form of an environment variable (QUERY_STRING).

When you use METHOD=POST, the form data is given to the form processor as the standard input to the program.

Page 6: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

How to Create a Form?

Page 7: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

How to Create a Form?

NAME:

Assigns the form a name accessible by bookmark, script, and applet resources.

Page 8: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

How to Create a Form?

STYLE:

Specifies Style Sheet commands that apply to the contents within the <FORM> tags.

Page 9: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

How to Create a Form?

OTHER ATTRIBUTES:

Many other attributes are available. Those include: Onsubmit, onreset, onClick, onDblClick, onMouseDown, onMouseUp, nMouseOver, onMouseMove, onMouseOut, onKeyPress, onKeyDown, and onKeyUp attributes.

Page 10: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <Input>

Identifies several input methods for form.

This tag must appear between the opening and closing <FORM> tags.

Sample:<FORM METHOD=POST>

<INPUT TYPE=“TEXT” NAME=“qty” SIZE=5>

<INPUT TYPE=“submit” VALUE=“Order”>

</FORM>

Page 11: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <Input>

With the code in previous slide, Firefox displays:

Page 12: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <Input>

The type of <input> can be: Type = {image, submit, button,

text, checkbox, file, password, radio, reset, hidden}

See the following slides.

Page 13: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <Input>

13

Page 14: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <Input>

With the codes in previous slide, the browser Firefox displays:

Page 15: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <TEXTAREA>

Defines a multiple-line text input field within a form.

Place the <TEXTAREA> tags inside the <FORM> tags.

To specify a default value in a <TEXTAREA> field, place the text between the <TEXTAREA> tags.

Page 16: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <TEXTAREA>

The <textarea> has many attributes, for example, ID, style, name, etc. See the example on how to use these attributes next slide.

Page 17: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <TEXTAREA>

Page 18: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

FORM: <SELECT>

<SELECT>Specifies a selection list within a

form. Use the <OPTION> tags to

specify items in the selection list.

Page 19: 1 Chapter 05: Creating Your Form. What is a Form? When you visit some websites you see a form. With this form, you are asked to complete, for example,

HOMEWORK

Go to Gmail account sign-up page. Design the same webpage using your own techniques.

Try again with Yahoo sign-up form.