Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Form Fields | Advanced Concepts
Introduction to HTML

bookForm Fields

Text fields allow users to enter a single line of text.

index.html

index.html

copy
  • The label element is used to provide a label for the text field;
  • The input element is used to create the text field;
  • The type attribute specifies that this is a text field. You can set type="date", type="number" etc.;
  • The id and name attributes uniquely identify the field.

Radio buttons allow users to select a single option from a list of options.

index.html

index.html

copy

The value attribute specifies the value submitted with the form when a particular radio button is selected.

textarea elements allow users to enter multiple lines of text.

index.html

index.html

copy

This textarea element would be displayed on the web page as a blank field where the user can type in a message. The rows and cols attributes are used to specify the size of the textarea in terms of the number of rows and columns.

Task

  1. Add a "name" field, which should be a simple text field (type="text").
  2. Add a <label> field for the "email" text field below.
  3. Fill in the radio button below, similar to the one done above for the male option.
  4. Create a radio button for the option "other" below, similar to the one done above for the female option. Also, add a <label>.
  5. Add a submit button here.

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 5. Luku 4

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Suggested prompts:

Kysy minulta kysymyksiä tästä aiheesta

Tiivistä tämä luku

Näytä käytännön esimerkkejä

Awesome!

Completion rate improved to 3.45

bookForm Fields

Pyyhkäise näyttääksesi valikon

Text fields allow users to enter a single line of text.

index.html

index.html

copy
  • The label element is used to provide a label for the text field;
  • The input element is used to create the text field;
  • The type attribute specifies that this is a text field. You can set type="date", type="number" etc.;
  • The id and name attributes uniquely identify the field.

Radio buttons allow users to select a single option from a list of options.

index.html

index.html

copy

The value attribute specifies the value submitted with the form when a particular radio button is selected.

textarea elements allow users to enter multiple lines of text.

index.html

index.html

copy

This textarea element would be displayed on the web page as a blank field where the user can type in a message. The rows and cols attributes are used to specify the size of the textarea in terms of the number of rows and columns.

Task

  1. Add a "name" field, which should be a simple text field (type="text").
  2. Add a <label> field for the "email" text field below.
  3. Fill in the radio button below, similar to the one done above for the male option.
  4. Create a radio button for the option "other" below, similar to the one done above for the female option. Also, add a <label>.
  5. Add a submit button here.

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 5. Luku 4
some-alt