Forms Flashcards

1
Q

How do forms works

A

User fills in the form The name and value of each form control the user selects is sent to the server Server processes info (Possibly stores it in a database) Server sends a message back to the user

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

How is data sent to the server?

A

In name/value pairs. Nmae is what type of content it is value the actual content

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

What’s the syntax for a adding a form?

A

form action=”process.php” id=”signUp” method=”get”>

action - linked to code to process the page once it’s submitted method - how the data should be sent to the server (HTTP method) e.g. GET, POST id - uniquely identifies the form

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

When should you use GET and POST methods?

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

How do you add a text input

A

``

name - used to identify the data maxlength - control how many characters

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

How do you add a password input

A

``

` `

` `

type - using password, masks the characters name - used to identify the data maxlength - control how many characters

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

How do you add a text area

A

encode<textarea>Please add comments encode</textarea>

name - used to identify the data Any text included between the tags will initially display in the text box to its active

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

How do you add a radio button

A

<input></input>iOS4 <input></input>iOS5 <input></input>iOS6 <input></input>iOS7 <input></input>iOS8

name - used to identify the data value - the value passed to the server checked attribute can be added to element to select it. Only one radio button can be selected

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

How do you add checkboxes

A

<input></input>iOS4 <input></input>iOS5 <input></input>iOS6 <input></input>iOS7 <input></input>iOS8

name - used to identify the data value - the value passed to the server checked attribute can be added to element to select it.

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

How do you add a dropdown list

A

<label>Device</label>

<select></select>

<option>-- Please Select --</option> <option>iPad</option> <option>iPhone</option> <option>iPad</option> <option>iWatch</option> <option>iCamera</option>

iPod iPhone iPad name - used to identify the data value - the value passed to the server User can only select one option selected attribute can be added to an option tag

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

How do I turn a dropdown list to a select box

A

<label>Device</label>

<select> </select>

<option>-- Please Select --</option> <option>iPad</option> <option>iPhone</option> <option>iPad</option> <option>iWatch</option> <option>iCamera</option>

Giver it a size attribute ` iPod iPhone iPad ` name - used to identify the data value - the value passed to the server User can only select one option selected attribute can be added to an option tag multiple attribute - allows multiple selections

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

How do you add a file upload

A

<input></input>

Must be sent as POST Automatically adds a browse button

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

How do you add a submit button

A

<input></input>

Cane use a name attribute (doesn’t need to)

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

How do you add an image button

A

<input></input>

Use this to add an image for a submit button

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

How do you add a button

A

<button> <p> Sign this /</p></button>

<p> </p>

</button>

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

How do you submit a value without showing it to the use

A

<input></input>

17
Q

How do you add a label for a form control

A

<label> </label><input></input>

18
Q

How can you group related form elements together

A

<fieldset> <legend>Sign Up <legend></legend> <form> <label>Username</label> <input></input> <br></br><br></br><label>Password</label> <input></input> <br></br><br></br><input></input> <fieldset>

<p>Fieldset tag</p>

<p>legend idenfies the grouped elements</p>

<p> </p>

Sign Up <br></br>Username <br></br>Password <br></br>
</fieldset>
</form>
</legend>
</fieldset>