Forms Flashcards

1
Q

How to create forms?

A

form, label input and button should be used.

<div></div>

submit   

we add div because form elements are inline elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to move the input to the next line?

A

make label as block;

display: block;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to add space between the text and the input field ?

A

use padding for input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is attribute selector?

A

Suppose only text and email input fields should have the styles then use attribute selector.

input[type=”text”]{

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to remove default border of the input field?

A

outline:0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to add shadow to the boxes?

A

box-shadow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to create a text area?

A

textarea tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to add a pre-populated value in the input field?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to add a grey text in the input field?

A

placeholder=””

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to make a readonly in input field?

A

readonly=””

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to grey out the input field?

A

disable=”” value will not be sent to the server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to limit the characters in the input field?

A

maxlength

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to focus the inout field automatically whne the page loads?

A

use autofocus.. it is a boolen attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to show suggestions in the text?

A

use datalist.

a. in datalist give id=”name” and in input give list=”name”. this is to link the datalist to the input.
b. in input field provide, autocomplete=”off”.
c.

Canada      ...
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to show a drop down list?

A

use select and option tags

  select a course 
  HTML
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to group a few elements?

A

Pyament

..

17
Q

What are hidden fields?

A

WHen we are sending data to the server we want to send some more data about the fields to the server. To send the data we use hidden field.

never store sensitive data in the hidden input field.