Tuesday 25 March 2014

Handling Text Fields, Explained!

My last post was about Handling Text Fields.

So let's stop wasting time and start our work.


The Code Was



1. <html>
2. <head><title>Form</title></head>
3.
<body>

4. <Form method="post" action="Input.php">

5. First Name: <input type="text" required name="firstname"  placeholder="First Name"><BR>

6. Last Name: <input type="text" required name="lastname" placeholder="Last Name"><BR>

7. Username: <input type="text" required name="username" placeholder="Username"><BR>

8. Email: <input type="email" required name="email" placeholder="Email"><BR>

9. Password: <input type="password" required name="password" placeholder="Password"><BR>

10. <input type="submit"><BR>

11. </Form>
12. </body>
13. </html>



Okay, I'll explain you this line by line

1. HTML document starts.

2. Heading, and all that things.

3. Starting body tag.

4. Starting our Form tag, method = post, There are two methods of form tag and they are get and post, Difference between them is classified here.

5. In the html document it displays "First Name:  ", 
type attribute means what type of text should be displayed,
required attribute means that without completing this field you cannot proceed.
name attribute specifies a text field this is a very useful without this we cannot work, this'll be explained later.
placeholder this attribute displays "First Name" like this in a text field like this                             First Name:  
watch there's written Name which disappears whenever you write something there.

6. Same thing is happening here too.

7. Here too.

8. Here is also the same thing but with a slight change,
type = email, which means it's an email field and it shows all the emails ever entered on that pc. It Looks Like This


9. Here is also same thing but again a slight change,
type = password, this means that when something is entered in that field it converts them into dots like this

10. This is a button which takes you to the location specified in the starting of our form which is Input.php it looks like this 

11. Our Form Closes.

12. Our Body Closes.

13. Our html closes


Now Starts the Input.php





No comments:

Post a Comment