Forms Flashcards
How to create forms?
form, label input and button should be used.
<div></div>
submit
we add div because form elements are inline elements.
How to move the input to the next line?
make label as block;
display: block;
How to add space between the text and the input field ?
use padding for input
What is attribute selector?
Suppose only text and email input fields should have the styles then use attribute selector.
input[type=”text”]{
…
}
How to remove default border of the input field?
outline:0
How to add shadow to the boxes?
box-shadow
How to create a text area?
textarea tag
How to add a pre-populated value in the input field?
How to add a grey text in the input field?
placeholder=””
How to make a readonly in input field?
readonly=””
How to grey out the input field?
disable=”” value will not be sent to the server.
How to limit the characters in the input field?
maxlength
How to focus the inout field automatically whne the page loads?
use autofocus.. it is a boolen attribute.
How to show suggestions in the text?
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 to show a drop down list?
use select and option tags
select a course HTML