From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- files/my/learn/css/css_layout/flexbox/index.html | 339 ---------------------- files/my/learn/css/css_layout/index.html | 88 ------ files/my/learn/css/index.html | 67 ----- files/my/learn/forms/html5_input_types/index.html | 277 ------------------ files/my/learn/forms/index.html | 84 ------ files/my/learn/forms/your_first_form/index.html | 299 ------------------- files/my/learn/html/index.html | 52 ---- files/my/learn/index.html | 89 ------ files/my/learn/javascript/index.html | 66 ----- 9 files changed, 1361 deletions(-) delete mode 100644 files/my/learn/css/css_layout/flexbox/index.html delete mode 100644 files/my/learn/css/css_layout/index.html delete mode 100644 files/my/learn/css/index.html delete mode 100644 files/my/learn/forms/html5_input_types/index.html delete mode 100644 files/my/learn/forms/index.html delete mode 100644 files/my/learn/forms/your_first_form/index.html delete mode 100644 files/my/learn/html/index.html delete mode 100644 files/my/learn/index.html delete mode 100644 files/my/learn/javascript/index.html (limited to 'files/my/learn') diff --git a/files/my/learn/css/css_layout/flexbox/index.html b/files/my/learn/css/css_layout/flexbox/index.html deleted file mode 100644 index 03bc087105..0000000000 --- a/files/my/learn/css/css_layout/flexbox/index.html +++ /dev/null @@ -1,339 +0,0 @@ ---- -title: Flexbox -slug: Learn/CSS/CSS_layout/Flexbox -translation_of: Learn/CSS/CSS_layout/Flexbox ---- -
{{LearnSidebar}}
- -
{{PreviousMenuNext("LearnSS_layout/Normal_Flow", "Learn/CSS/CSS_layout/Grids", "Learn/CSS/CSS_layout")}}
- -

Flexbox is a one-dimensional layout method for laying out items in rows or columns. Items flex to fill additional space and shrink to fit into smaller spaces. This article explains all the fundamentals.

- - - - - - - - - - - - -
Prerequisites:HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS.)
Objective:To learn how to use the Flexbox layout system to create web layouts.
- -

Why Flexbox?

- -

For a long time, the only reliable cross browser-compatible tools available for creating CSS layouts were things like floats and positioning. These are fine and they work, but in some ways they are also rather limiting and frustrating.

- -

The following simple layout requirements are either difficult or impossible to achieve with such tools, in any kind of convenient, flexible way:

- - - -

As you'll see in subsequent sections, flexbox makes a lot of layout tasks much easier. Let's dig in!

- -

Introducing a simple example

- -

In this article we are going to get you to work through a series of exercises to help you understand how flexbox works. To get started, you should make a local copy of the first starter file — flexbox0.html from our github repo — load it in a modern browser (like Firefox or Chrome), and have a look at the code in your code editor. You can see it live here also.

- -

You'll see that we have a {{htmlelement("header")}} element with a top level heading inside it, and a {{htmlelement("section")}} element containing three {{htmlelement("article")}}s. We are going to use these to create a fairly standard three column layout.

- -

- -

Specifying what elements to lay out as flexible boxes

- -

To start with, we need to select which elements are to be laid out as flexible boxes. To do this, we set a special value of {{cssxref("display")}} on the parent element of the elements you want to affect. In this case we want to lay out the {{htmlelement("article")}} elements, so we set this on the {{htmlelement("section")}}:

- -
section {
-  display: flex;
-}
- -

This causes the <section> element to become a flex container, and its children to become flex items. The result of this should be something like so:

- -

- -

So, this single declaration gives us everything we need — incredible, right? We have our multiple column layout with equal sized columns, and the columns are all the same height. This is because the default values given to flex items (the children of the flex container) are set up to solve common problems such as this.

- -

To be clear, let's reiterate what is happening here. The element we've given a   {{cssxref("display")}} value of flex to is acting like a block-level element in terms of how it interacts with the rest of the page, but its children are being laid out as flex items — the next section will explain in more detail what this means. Note also that you can use a display value of inline-flex if you wish to lay out an element's children as flex items, but have that element behave like an inline element.

- -

The flex model

- -

When elements are laid out as flex items, they are laid out along two axes:

- -

flex_terms.png

- - - -

Bear this terminology in mind as you go through subsequent sections. You can always refer back to it if you get confused about any of the terms being used.

- -

Columns or rows?

- -

Flexbox provides a property called {{cssxref("flex-direction")}} that specifies what direction the main axis runs in (what direction the flexbox children are laid out in) — by default this is set to row, which causes them to be laid out in a row in the direction your browser's default language works in (left to right, in the case of an English browser).

- -

Try adding the following declaration to your {{htmlelement("section")}} rule:

- -
flex-direction: column;
- -

You'll see that this puts the items back in a column layout, much like they were before we added any CSS. Before you move on, delete this declaration from your example.

- -
-

Note: You can also lay out flex items in a reverse direction using the row-reverse and column-reverse values. Experiment with these values too!

-
- -

Wrapping

- -

One issue that arises when you have a fixed amount of width or height in your layout is that eventually your flexbox children will overflow their container, breaking the layout. Have a look at our flexbox-wrap0.html example, and try viewing it live (take a local copy of this file now if you want to follow along with this example):

- -

- -

Here we see that the children are indeed breaking out of their container. One way in which you can fix this is to add the following declaration to your {{htmlelement("section")}} rule:

- -
flex-wrap: wrap;
- -

Also, add the following declaration to your {{htmlelement("article")}} rule:

- -
flex: 200px;
- -

Try this now; you'll see that the layout looks much better with this included:

- -

We now have multiple rows — as many flexbox children are fitted onto each row as makes sense, and any overflow is moved down to the next line. The flex: 200px declaration set on the articles means that each will be at least 200px wide; we'll discuss this property in more detail later on. You might also notice that the last few children on the last row are each made wider so that the entire row is still filled.

- -

But there's more we can do here. First of all, try changing your {{cssxref("flex-direction")}} property value to row-reverse — now you'll see that you still have your multiple row layout, but it starts from the opposite corner of the browser window and flows in reverse.

- -

flex-flow shorthand

- -

At this point it is worth noting that a shorthand exists for {{cssxref("flex-direction")}} and {{cssxref("flex-wrap")}} — {{cssxref("flex-flow")}}. So for example, you can replace

- -
flex-direction: row;
-flex-wrap: wrap;
- -

with

- -
flex-flow: row wrap;
- -

Flexible sizing of flex items

- -

Let's now return to our first example, and look at how we can control what proportion of space flex items take up compared to the other flex items. Fire up your local copy of flexbox0.html, or take a copy of flexbox1.html as a new starting point (see it live).

- -

First, add the following rule to the bottom of your CSS:

- -
article {
-  flex: 1;
-}
- -

This is a unitless proportion value that dictates how much of the available space along the main axis each flex item will take up compared to other flex items. In this case, we are giving each {{htmlelement("article")}} element the same value (a value of 1), which means they will all take up an equal amount of the spare space left after things like padding and margin have been set. It is relative to other flex items, meaning that giving each flex item a value of 400000 would have exactly the same effect.

- -

Now add the following rule below the previous one:

- -
article:nth-of-type(3) {
-  flex: 2;
-}
- -

Now when you refresh, you'll see that the third {{htmlelement("article")}} takes up twice as much of the available width as the other two — there are now four proportion units available in total (since 1 + 1 + 2 = 4). The first two flex items have one unit each so they take 1/4 of the available space each. The third one has two units, so it takes up 2/4 of the available space (or one-half).

- -

You can also specify a minimum size value inside the flex value. Try updating your existing article rules like so:

- -
article {
-  flex: 1 200px;
-}
-
-article:nth-of-type(3) {
-  flex: 2 200px;
-}
- -

This basically states "Each flex item will first be given 200px of the available space. After that, the rest of the available space will be shared out according to the proportion units." Try refreshing and you'll see a difference in how the space is shared out.

- -

- -

The real value of flexbox can be seen in its flexibility/responsiveness — if you resize the browser window, or add another {{htmlelement("article")}} element, the layout continues to work just fine.

- -

flex: shorthand versus longhand

- -

{{cssxref("flex")}} is a shorthand property that can specify up to three different values:

- - - -

We'd advise against using the longhand flex properties unless you really have to (for example, to override something previously set). They lead to a lot of extra code being written, and they can be somewhat confusing.

- -

Horizontal and vertical alignment

- -

You can also use flexbox features to align flex items along the main or cross axis. Let's explore this by looking at a new example — flex-align0.html (see it live also) — which we are going to turn into a neat, flexible button/toolbar. At the moment you'll see a horizontal menu bar, with some buttons jammed into the top left hand corner.

- -

- -

First, take a local copy of this example.

- -

Now, add the following to the bottom of the example's CSS:

- -
div {
-  display: flex;
-  align-items: center;
-  justify-content: space-around;
-}
- -

- -

Refresh the page and you'll see that the buttons are now nicely centered, horizontally and vertically. We've done this via two new properties.

- -

{{cssxref("align-items")}} controls where the flex items sit on the cross axis.

- - - -

You can override the {{cssxref("align-items")}} behavior for individual flex items by applying the {{cssxref("align-self")}} property to them. For example, try adding the following to your CSS:

- -
button:first-child {
-  align-self: flex-end;
-}
- -

- -

Have a look at what effect this has, and remove it again when you've finished.

- -

{{cssxref("justify-content")}} controls where the flex items sit on the main axis.

- - - -

We'd like to encourage you to play with these values to see how they work before you continue.

- -

Ordering flex items

- -

Flexbox also has a feature for changing the layout order of flex items, without affecting the source order. This is another thing that is impossible to do with traditional layout methods.

- -

The code for this is simple: try adding the following CSS to your button bar example code:

- -
button:first-child {
-  order: 1;
-}
- -

Refresh, and you'll now see that the "Smile" button has moved to the end of the main axis. Let's talk about how this works in a bit more detail:

- - - -

You can set negative order values to make items appear earlier than items with 0 set. For example, you could make the "Blush" button appear at the start of the main axis using the following rule:

- -
button:last-child {
-  order: -1;
-}
- -

Nested flex boxes

- -

It is possible to create some pretty complex layouts with flexbox. It is perfectly ok to set a flex item to also be a flex container, so that its children are also laid out like flexible boxes. Have a look at complex-flexbox.html (see it live also).

- -

- -

The HTML for this is fairly simple. We've got a {{htmlelement("section")}} element containing three {{htmlelement("article")}}s. The third {{htmlelement("article")}} contains three {{htmlelement("div")}}s. :

- -
section - article
-          article
-          article - div - button
-                    div   button
-                    div   button
-                          button
-                          button
- -

Let's look at the code we've used for the layout.

- -

First of all, we set the children of the {{htmlelement("section")}} to be laid out as flexible boxes.

- -
section {
-  display: flex;
-}
- -

Next, we set some flex values on the {{htmlelement("article")}}s themselves. Take special note of the 2nd rule here — we are setting the third {{htmlelement("article")}} to have its children laid out like flex items too, but this time we are laying them out like a column.

- -
article {
-  flex: 1 200px;
-}
-
-article:nth-of-type(3) {
-  flex: 3 200px;
-  display: flex;
-  flex-flow: column;
-}
-
- -

Next, we select the first {{htmlelement("div")}}. We first use flex:1 100px; to effectively give it a minimum height of 100px, then we set its children (the {{htmlelement("button")}} elements) to also be laid out like flex items. Here we lay them out in a wrapping row, and align them in the center of the available space like we did in the individual button example we saw earlier.

- -
article:nth-of-type(3) div:first-child {
-  flex:1 100px;
-  display: flex;
-  flex-flow: row wrap;
-  align-items: center;
-  justify-content: space-around;
-}
- -

Finally, we set some sizing on the button, but more interestingly we give it a flex value of 1 auto. This has a very interesting effect, which you'll see if you try resizing your browser window width. The buttons will take up as much space as they can and sit as many on the same line as they can, but when they can no longer fit comfortably on the same line, they'll drop down to create new lines.

- -
button {
-  flex: 1 auto;
-  margin: 5px;
-  font-size: 18px;
-  line-height: 1.5;
-}
- -

Cross browser compatibility

- -

Flexbox support is available in most new browsers — Firefox, Chrome, Opera, Microsoft Edge and IE 11, newer versions of Android/iOS, etc. However you should be aware that there are still older browsers in use that don't support Flexbox (or do, but support a really old, out-of-date version of it.)

- -

While you are just learning and experimenting, this doesn't matter too much; however if you are considering using flexbox in a real website you need to do testing and make sure that your user experience is still acceptable in as many browsers as possible.

- -

Flexbox is a bit trickier than some CSS features. For example, if a browser is missing a CSS drop shadow, then the site will likely still be usable. Not supporting flexbox features however will probably break a layout completely, making it unusable.

- -

We discuss strategies for overcoming cross browser support issues in our Cross browser testing module.

- -

Test your skills!

- -

We have covered a lot in this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on — see Test your skills: Flexbox.

- -

Summary

- -

That concludes our tour of the basics of flexbox. We hope you had fun, and will have a good play around with it as you travel forward with your learning. Next we'll have a look at another important aspect of CSS layouts — CSS Grids.

- -
{{PreviousMenuNext("Learn/CSS/CSS_layout/Normal_Flow", "Learn/CSS/CSS_layout/Grids", "Learn/CSS/CSS_layout")}}
- -
-

In this module

- - -
diff --git a/files/my/learn/css/css_layout/index.html b/files/my/learn/css/css_layout/index.html deleted file mode 100644 index 0268f74856..0000000000 --- a/files/my/learn/css/css_layout/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: CSS layout -slug: Learn/CSS/CSS_layout -tags: - - Beginner - - CSS - - Floating - - Grids - - Guide - - Landing - - Layout - - Learn - - Module - - Multiple column - - NeedsTranslation - - Positioning - - TopicStub - - alignment - - flexbox - - float - - table -translation_of: Learn/CSS/CSS_layout ---- -
{{LearnSidebar}}
- -

At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. Now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about.

- -
-

Looking to become a front-end web developer?

- -

We have put together a course that includes all the essential information you need to work towards your goal.

- -

Get started

-
- -

Prerequisites

- -

Before starting this module, you should already:

- -
    -
  1. Have basic familiarity with HTML, as discussed in the Introduction to HTML module.
  2. -
  3. Be comfortable with CSS fundamentals, as discussed in Introduction to CSS.
  4. -
  5. Understand how to style boxes.
  6. -
- -
-

Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Glitch.

-
- -

Guides

- -

These articles will provide instruction on the fundamental layout tools and techniques available in CSS. At the end of the lessons is an assessment to help you check your understanding of layout methods, by laying out a webpage.

- -
-
Introduction to CSS layout
-
This article will recap some of the CSS layout features we've already touched upon in previous modules — such as different {{cssxref("display")}} values — and introduce some of the concepts we'll be covering throughout this module.
-
Normal flow
-
Elements on webpages lay themselves out according to normal flow - until we do something to change that. This article explains the basics of normal flow as a grounding for learning how to change it.
-
Flexbox
-
Flexbox is a one-dimensional layout method for laying out items in rows or columns. Items flex to fill additional space and shrink to fit into smaller spaces. This article explains all the fundamentals. After studying this guide you can test your flexbox skills to check your understanding before moving on.
-
Grids
-
CSS Grid Layout is a two-dimensional layout system for the web. It lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward. This article will give you all you need to know to get started with page layout, then test your grid skills before moving on.
-
Floats
-
Originally for floating images inside blocks of text, the {{cssxref("float")}} property became one of the most commonly used tools for creating multiple column layouts on webpages. With the advent of Flexbox and Grid it has now returned to its original purpose, as this article explains.
-
Positioning
-
Positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser viewport. This article explains the different {{cssxref("position")}} values, and how to use them.
-
Multiple-column layout
-
The multiple-column layout specification gives you a method of laying content out in columns, as you might see in a newspaper. This article explains how to use this feature.
-
Responsive design
-
As more diverse screen sizes have appeared on web-enabled devices, the concept of responsive web design (RWD) has appeared: a set of practices that allows web pages to alter their layout and appearance to suit different screen widths, resolutions, etc. It is an idea that changed the way we design for a multi-device web, and in this article we'll help you understand the main techniques you need to know to master it.
-
Beginner's guide to media queries
-
The CSS Media Query gives you a way to apply CSS only when the browser and device environment matches a rule that you specify, for example "viewport is wider than 480 pixels". Media queries are a key part of responsive web design, as they allow you to create different layouts depending on the size of the viewport, but they can also be used to detect other things about the environment your site is running on, for example whether the user is using a touchscreen rather than a mouse. In this lesson you will first learn about the syntax used in media queries, and then move on to use them in a worked example showing how a simple design might be made responsive.
-
Legacy layout methods
-
Grid systems are a very common feature used in CSS layouts, and before CSS Grid Layout they tended to be implemented using floats or other layout features. You imagine your layout as a set number of columns (e.g. 4, 6, or 12), and then fit your content columns inside these imaginary columns. In this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project.
-
Supporting older browsers
-
-

In this module we recommend using Flexbox and Grid as the main layout methods for your designs. However there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used. This will always be the case on the web — as new features are developed, different browsers will prioritise different things. This article explains how to use modern web techniques without locking out users of older technology.

-
-
Assessment: Fundamental layout comprehension
-
An assessment to test your knowledge of different layout methods by laying out a webpage.
-
- -

See also

- -
-
Practical positioning examples
-
This article shows how to build some real world examples to illustrate what kinds of things you can do with positioning.
-
diff --git a/files/my/learn/css/index.html b/files/my/learn/css/index.html deleted file mode 100644 index 781ea7fb45..0000000000 --- a/files/my/learn/css/index.html +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: CSS နင့် HTML အား အသွင်ပောင်းခင်း -slug: Learn/CSS -tags: - - Beginner - - CSS - - CodingScripting - - Debugging - - Landing - - NeedsContent - - NeedsTranslation - - Style - - Topic - - TopicStub - - length - - specificity -translation_of: Learn/CSS ---- -
{{LearnSidebar}}
- -

Cascading Stylesheets — or {{glossary("CSS")}} — is the first technology you should start learning after {{glossary("HTML")}}. While HTML is used to define the structure and semantics of your content, CSS is used to style it and lay it out. For example, you can use CSS to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.

- -

သင်ယူမုဆိုင်ရာ လမ်းေကာင်း

- -

You should learn the basics of HTML before attempting any CSS. We recommend that you work through our Introduction to HTML module first. In that module, you will learn about:

- - - -

Once you understand the fundamentals of HTML, we recommend that you learn HTML and CSS at the same time, moving back and forth between the two topics. This is because HTML is far more interesting and much more fun to learn when you apply CSS, and you can't really learn CSS without knowing HTML.

- -

Before starting this topic, you should also be familiar with using computers and using the web passively (i.e., just looking at it, consuming the content). You should have a basic work environment set up as detailed in Installing basic software and understand how to create and manage files, as detailed in Dealing with files — both of which are parts of our Getting started with the web complete beginner's module.

- -

It is recommended that you work through Getting started with the web before proceeding with this topic. However, doing so isn't absolutely necessary as much of what is covered in the CSS basics article is also covered in our Introduction to CSS module, albeit in a lot more detail.

- -

သင်ရိုး

- -

This topic contains the following modules, in a suggested order for working through them. You should definitely start with the first one.

- -
-
Introduction to CSS
-
This module gets you started with the basics of how CSS works, including using selectors and properties; writing CSS rules; applying CSS to HTML; specifying length, color, and other units in CSS; controlling cascade and inheritance; understanding box model basics; and debugging CSS.
-
Styling text
-
Here, we look at text-styling fundamentals, including setting font, boldness, and italics; line and letter spacing; and drop shadows and other text features. We round off the module by looking at applying custom fonts to your page and styling lists and links.
-
Styling boxes
-
Next up, we look at styling boxes, one of the fundamental steps towards laying out a web page. In this module, we recap the box model, then look at controlling box layouts by setting padding, borders and margins, setting custom background colors, images, and fancy features such as drop shadows and filters on boxes.
-
CSS layout
-
At this point, we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. Now, it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about.
-
Responsive design (TBD)
-
With so many different types of devices able to browse the web these days, responsive web design (RWD) has become a core web development skill. This module will cover the basic principles and tools of RWD; explain how to apply different CSS to a document depending on device features like screen width, orientation, and resolution; and explore the technologies available for serving different videos and images depending on such features.
-
- -

CSS ဆိုင်ရာ ပသနာများဖေရင်းခင်း

- -

Use CSS to solve common problems provides links to sections of content explaining how to use CSS to solve very common problems when creating a web page.

- -

From the beginning, you'll primarily apply colors to HTML elements and their backgrounds; change the size, shape, and position of elements; and add and define borders on elements. But there's not much you can't do once you have a solid understanding of even the basics of CSS. One of the best things about learning CSS is that once you know the fundamentals, usually you have a pretty good feel for what can and can't be done, even if you don't actually know how to do it yet!

- -

ပိုမိုလေ့လာရန်

- -
-
CSS on MDN
-
The main entry point for CSS documentation on MDN, where you'll find detailed reference documentation for all features of the CSS language. Want to know all the values a property can take? This is a good place to go.
-
diff --git a/files/my/learn/forms/html5_input_types/index.html b/files/my/learn/forms/html5_input_types/index.html deleted file mode 100644 index 1e3a209b8c..0000000000 --- a/files/my/learn/forms/html5_input_types/index.html +++ /dev/null @@ -1,277 +0,0 @@ ---- -title: The HTML5 input types -slug: Learn/Forms/HTML5_input_types -translation_of: Learn/Forms/HTML5_input_types -original_slug: Learn/HTML/Forms/HTML5_input_types ---- -
{{LearnSidebar}}
- -
{{PreviousMenuNext("Learn/Forms/Basic_native_form_controls", "Learn/Forms/Other_form_controls", "Learn/Forms")}}
- -

In the previous article we looked at the {{htmlelement("input")}} element, covering the original values of the type attribute available since the early days of HTML. Now we'll look at the functionality of newer form controls in detail, including some new input types, which were added in HTML5 to allow collection of specific types of data.

- - - - - - - - - - - - -
Prerequisites:Basic computer literacy, and a basic understanding of HTML.
Objective:To understand the newer input type values available to create native form controls, and how to implement them using HTML.
- -
-

Note: Most of the features discussed in this article have wide support across browsers. We'll note any exceptions. If you want more detail on browser support, you should consult our HTML forms element reference, and in particular our extensive <input> types reference.

-
- -

Because HTML form control appearance may be quite different from a designer's specifications, web developers sometimes build their own custom form controls. We cover this in an advanced tutorial — How to build custom form widgets.

- -

E-mail address field

- -

This type of field is set using the value email for the {{htmlattrxref("type","input")}} attribute:

- -
<input type="email" id="email" name="email">
- -

When this {{htmlattrxref("type","input")}} is used, the user is required to type a valid email address into the field. Any other content causes the browser to display an error when the form is submitted. You can see this in action in the below screenshot.

- -

An invalid email input showing the message "Please enter an email address."

- -

You can also use the multiple attribute in combination with the email input type to allow several email addresses to be entered in the same input (separated by commas):

- -
<input type="email" id="email" name="email" multiple>
- -

On some devices — notably, touch devices with dynamic keyboards like smart phones — a different virtual keypad might be presented that is more suitable for entering email addresses, including the @ key. See the Firefox for Android keyboard screenshot below for an example:

- -

firefox for android email keyboard, with ampersand displayed by default.

- -
-

Note: You can find examples of the basic text input types at basic input examples (see the source code also).

-
- -

This is another good reason for using these newer input types — improving the user experience for users of these devices.

- -

Client-side validation

- -

As you can see above, email, along with other newer input types, provides built-in client-side error validation — performed by the browser before the data gets sent to the server. It is a helpful aid to guide users to fill out a form accurately, and it can save time — it is useful to know that your data is not correct immediately, rather than having to wait for a round trip to the server.

- -

But it should not be considered an exhaustive security measure! Your apps should always perform security checks on any form-submitted data on the server-side as well as the client-side, because client-side validation is too easy to turn off, so malicious users can still easily send bad data through to your server. Read Website security for an idea of what could happen; implementing server-side validation is somewhat beyond the scope of this module, but you should bear it in mind.

- -

Note that a@b is a valid email address according to the default provided constraints. This is because the email input type allows intranet email addresses by default. To implement different validation behavior, you can use the pattern attribute, and you can also custom the error messages; we'll talk how to use these features in the Client-side form validation article later on.

- -
-

Note: If the data entered is not an email address, the {{cssxref(':invalid')}} pseudo-class will match, and the {{domxref('validityState.typeMismatch')}} property will return true.

-
- -

Search field

- -

Search fields are intended to be used to create search boxes on pages and apps. This type of field is set by using the value search for the {{htmlattrxref("type","input")}} attribute:

- -
<input type="search" id="search" name="search">
- -

The main difference between a text field and a search field is how the browser styles its appearance.  Often, search fields are rendered with rounded corners; they also sometimes display an "Ⓧ", which clears the field of any value when clicked). Additionally, on devices with dynamic keyboards, the keyboard's enter key may read "search", or display a magnifying glass icon.

- -

The below screenshots show a non-empty search field in Firefox 71, Safari 13, and Chrome 79 on macOS, and Edge 18 and Chrome 79 on Windows 10. Note the clear icon only appears if the field has a value, and, apart from Safari, it is only displayed when the field is focused.

- -

Screenshots of search fields on several platforms.

- -

Another feature worth noting is that the values of a search field can be automatically saved and re-used to offer auto-completion across multiple pages of the same website. This tends to happen automatically in most modern browsers.

- -

Phone number field

- -

A special field for filling in phone numbers can be created using tel as the value of the {{htmlattrxref("type","input")}} attribute:

- -
<input type="tel" id="tel" name="tel">
- -

When accessed via a touch device with a dynamic keyboard, most devices will display a numeric keypad when type="tel" is encountered, meaning this type is useful whenever a numeric keypad is useful, and doesn't just have to be used for telephone numbers.

- -

The following Firefox for Android keyboard screenshot provides an example:

- -

firefox for android email keyboard, with ampersand displayed by default.

- -

Due to the wide variety of phone number formats around the world, this type of field does not enforce any constraints on the value entered by a user. (This means it may include letters, etc.).

- -

As we mentioned earlier, The pattern attribute can be used to enforce constraints, which you'll learn about in Client-side form validation.

- -

URL field

- -

A special type of field for entering URLs can be created using the value url for the {{htmlattrxref("type","input")}} attribute:

- -
<input type="url" id="url" name="url">
- -

It adds special validation constraints to the field. The browser will report an error if no protocol (such as http:) is entered, or if the URL is otherwise malformed. On devices with dynamic keyboards, the default keyboard will often display some or all of the colon, period, and forward slash as default keys.

- -

See below for an example (taken on Fireox for Android):

- -

firefox for android email keyboard, with ampersand displayed by default.

- -
Note: Just because the URL is well-formed doesn't necessarily mean that it refers to a location that actually exists!
- -

Numeric field

- -

Controls for entering numbers can be created with an {{HTMLElement("input")}} {{htmlattrxref("type","input")}} of number. This control looks like a text field but allows only floating-point numbers, and usually provides buttons in the form of a spinner to increase and decrease the value of the control. On devices with dynamic keyboards, the numeric keyboard is generally displayed.

- -

The following screenshot (from Firefox for Android) provides an example:

- -

firefox for android email keyboard, with ampersand displayed by default.

- -

With the number input type, you can constrain the minimum and maximum values allowed by setting the {{htmlattrxref("min","input")}} and {{htmlattrxref("max","input")}} attributes.

- -

You can also use the step attribute to set the increment increase and decrease caused by pressing the spinner buttons. By default, the number input type only validates if the number is an integer. To allow float numbers, specify step="any". If omitted, the step value defaults to 1, meaning only whole numbers are valid.

- -

Let's look at some examples. The first one below creates a number control whose value is restricted to any value between 1 and 10, and whose increase and decrease buttons change its value by 2.

- -
<input type="number" name="age" id="age" min="1" max="10" step="2">
- -

The second one creates a number control whose value is restricted to any value between 0 and 1 inclusive, and whose increase and decrease buttons change its value by 0.01.

- -
<input type="number" name="change" id="pennies" min="0" max="1" step="0.01">
- -

The number input type makes sense when the range of valid values is limited, for example a person's age or height. If the range is too large for incremental increases to make sense (such as USA ZIP codes, which range from 00001 to 99999), the tel type might be a better option; it provides the numeric keypad while forgoing the number's spinner UI feature.

- -
-

Note: number inputs are not supported in versions of Internet Explorer below 10.

-
- -

Slider controls

- -

Another way to pick a number is to use a slider. You see these quite often on sites like housebuying sites where you want to set a maximum property price to filter by. Let's look at a live example to illustrate this:

- -

{{EmbedGHLiveSample("learning-area/html/forms/range-example/index.html", '100%', 200)}}

- -

Usage-wise, sliders are less accurate than text fields. Therefore, they are used to pick a number whose precise value is not necessarily important.

- -

A slider is created using the {{HTMLElement("input")}} with its {{htmlattrxref("type","input")}} attribute set to the value range. The slider-thumb can be moved via mouse or touch, or with the arrows of the keypad.

- -

It's important to properly configure your slider. To that end, it's highly recommended that you set the min, max, and step attributes which set the minimum, maximum and increment values, respectively.

- -

Let's look at the code behind the above example, so you can see how its done. First of all, the basic HTML:

- -
<label for="price">Choose a maximum house price: </label>
-<input type="range" name="price" id="price" min="50000" max="500000" step="100" value="250000">
-<output class="price-output" for="price"></output>
- -

This example creates a slider whose value may range between 50000 and 500000, which increments/decrements by 100 at a time. We've given it default value of 250000, using the value attribute.

- -

One problem with sliders is that they don't offer any kind of visual feedback as to what the current value is. This is why we've included an {{htmlelement("output")}} element — to contain the current value (we'll also look at this element in the next article). You could display an input value or the output of a calculation inside any element, but <output> is special — like <label>, it can take a for attribute that allows you to associate it with the element or elements that the output value came from.

- -

To actually display the current value, and update it as it changed, you must use JavaScript, but this is relatively easy to do:

- -
const price = document.querySelector('#price')
-const output = document.querySelector('.price-output')
-
-output.textContent = price.value
-
-price.addEventListener('input', function() {
-  output.textContent = price.value
-});
- -

Here we store references to the range input and the output in two variables. Then we immediately set the output's textContent to the current value of the input. Finally, an event listener is set to ensure that whenever the range slider is moved, the output's textContent is updated to the new value.

- -
-

Note: range inputs are not supported in versions of Internet Explorer below 10.

-
- -

Date and time pickers

- -

Gathering date and time values has traditionally been a nightmare for web developers. For good user experience, it is important to provide a calendar selection UI, enabling users to select dates without necessating context switching to a native calendar application or potentially entering them in differing formats that are hard to parse. The last minute of the previous millenium can be expressed in the following different ways, for example: 1999/12/31, 23:59 or 12/31/99T11:59PM.

- -

HTML date controls are available to handle this specific kind of data, providing calendar widgets and making the data uniform.

- -

A date and time control is created using the {{HTMLElement("input")}} element and an appropriate value for the {{htmlattrxref("type","input")}} attribute, depending on whether you wish to collect dates, times, or both. Here's a live example that falls back to {{htmlelement("select")}} elements in non-supporting browsers:

- -

{{EmbedGHLiveSample("learning-area/html/forms/datetime-local-picker-fallback/index.html", '100%', 200)}}

- -

Let's look at the different available types in brief. Note that the usage of these types is quite complex, especially considering browser support (see below); to find out the full details, follow the links below to the reference pages for each type, including detailed examples.

- -

datetime-local

- -

<input type="datetime-local"> creates a widget to display and pick a date with time with no specific time zone information.

- -
<input type="datetime-local" name="datetime" id="datetime">
- -

month

- -

<input type="month"> creates a widget to display and pick a month with a year.

- -
<input type="month" name="month" id="month">
- -

time

- -

<input type="time"> creates a widget to display and pick a time value. While time may display in 12-hour format, the value returned is in 24-hour format.

- -
<input type="time" name="time" id="time">
- -

week

- -

<input type="week"> creates a widget to display and pick a week number and its year.

- -

Weeks start on Monday and run to Sunday. Additionally, the first week 1 of each year contains the first Thursday of that year—which may not include the first day of the year, or may include the last few days of the previous year.

- -
<input type="week" name="week" id="week">
- -

Constraining date/time values

- -

All date and time controls can be constrained using the min and max attributes, with further constraining possible via the step attribute (whose value is given in seconds).

- -
<label for="myDate">When are you available this summer?</label>
-<input type="date" name="myDate" min="2013-06-01" max="2013-08-31" step="3600" id="myDate">
- -

Browser support for date/time inputs

- -

You should be warned that the date and time widgets don't have the best browser support. At the moment, Chrome, Edge, and Opera support them well, but there is no support in Internet Explorer, Safari has some mobile support (but no desktop support), and Firefox supports time and date only.

- -

The reference pages linked to above provide suggestions on how to program fallbacks for non-supporting browsers; another option is to consider using a JavaScript library to provide a date picker. Most modern frameworks have good components available to provide this functionality, and there are standalone libraries available to (see Top date picker javascript plugins and libraries for some suggestions).

- -

Color picker control

- -

Colors are always a bit difficult to handle. There are many ways to express them: RGB values (decimal or hexadecimal), HSL values, keywords, etc.

- -

A color control can be created using the {{HTMLElement("input")}} element with its {{htmlattrxref("type","input")}} attribute set to the value color:

- -
<input type="color" name="color" id="color">
- -

When supported, clicking a color control will tend to display the operating system's default color picking functionality for you to actually make your choice with. The following screenshot taken on Firefox for macOS provides an example:

- -

firefox for android email keyboard, with ampersand displayed by default.

- -

And here is a live example for you to try out:

- -

{{EmbedGHLiveSample("learning-area/html/forms/color-example/index.html", '100%', 200)}}

- -

The value returned is always a lowercase 6-value hexidecimal color.

- -
-

Note: color inputs are not supported in Internet Explorer.

-
- -

Summary

- -

That brings us to the end of our tour of the HTML5 form input types. There are a few other control types that cannot be easily grouped together due to their very specific behaviors, but which are still essential to know about. We cover those in the next article.

- -

{{PreviousMenuNext("Learn/Forms/Basic_native_form_controls", "Learn/Forms/Other_form_controls", "Learn/Forms")}}

- -

In this module

- - - -

Advanced Topics

- - diff --git a/files/my/learn/forms/index.html b/files/my/learn/forms/index.html deleted file mode 100644 index 03f1ed316c..0000000000 --- a/files/my/learn/forms/index.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: HTML forms -slug: Learn/Forms -tags: - - Beginner - - Featured - - Forms - - Guide - - HTML - - Landing - - Learn - - NeedsTranslation - - TopicStub - - Web -translation_of: Learn/Forms -original_slug: Learn/HTML/Forms ---- -
{{LearnSidebar}}
- -

This module provides a series of articles that will help you master HTML forms. HTML forms are a very powerful tool for interacting with users; however, for historical and technical reasons, it's not always obvious how to use them to their full potential. In this guide, we'll cover all aspects of HTML forms, from structure to styling, from data handling to custom widgets.

- -

Prerequisites

- -

Before starting this module, you should at least work through our Introduction to HTML. At this point you should find the {{anch("Basic guides")}} easy to understand, and also be able to make use of our Native form widgets guide.

- -

The rest of the module however is a bit more advanced — it is easy to put form widgets on a page, but you can't actually do much with them without using some advanced form features, CSS, and JavaScript. Therefore, before you look at the other sections we'd recommend that you go away and learn some CSS and JavaScript first.

- -
-

Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Thimble.

-
- -

Basic guides

- -
-
Your first HTML form
-
The first article in our series provides your very first experience of creating an HTML form, including designing a simple form, implementing it using the right HTML elements, adding some very simple styling via CSS, and how data is sent to a server.
-
How to structure an HTML form
-
With the basics out of the way, we now look in more detail at the elements used to provide structure and meaning to the different parts of a form.
-
- -

What form widgets are available?

- -
-
The native form widgets
-
We now look at the functionality of the different form widgets in detail, looking at what options are available to collect different types of data.
-
- -

Validating and submitting form data

- -
-
Sending form data
-
This article looks at what happens when a user submits a form — where does the data go, and how do we handle it when it gets there? We also look at some of the security concerns associated with sending form data.
-
Form data validation
-
Sending data is not enough — we also need to make sure that the data users fill out in forms is in the correct format we need to process it successfully, and that it won't break our applications. We also want to help our users to fill out our forms correctly and don't get frustrated when trying to use our apps. Form validation helps us achieve these goals — this article tells you what you need to know.
-
- -

Advanced guides

- -
-
How to build custom form widgets
-
You'll come across some cases where the native form widgets just don't provide what you need, e.g. because of styling or functionality. In such cases, you may need to build your own form widget out of raw HTML. This article explains how you'd do this and the considerations you need to be aware of when doing so, with a practical case study.
-
Sending forms through JavaScript
-
This article looks at ways to use a form to assemble an HTTP request and send it via custom JavaScript, rather than standard form submission. It also looks at why you'd want to do this, and the implications of doing so. (See also Using FormData objects.)
-
HTML forms in legacy browsers
-
Article covering feature detection, etc. This should be redirected to the cross browser testing module, as the same stuff is covered better there.
-
- -

Form styling guides

- -
-
Styling HTML forms
-
This article provides an introduction to styling forms with CSS, including all the basics you might need to know for basic styling tasks.
-
Advanced styling for HTML forms
-
Here we look at some more advanced form styling techniques that need to be used when trying to deal with some of the more difficult-to-style elements.
-
Property compatibility table for form widgets
-
This last article provides a handy reference allowing you to look up what CSS properties are compatible with what form elements.
-
- -

See also

- - diff --git a/files/my/learn/forms/your_first_form/index.html b/files/my/learn/forms/your_first_form/index.html deleted file mode 100644 index ec562f30b2..0000000000 --- a/files/my/learn/forms/your_first_form/index.html +++ /dev/null @@ -1,299 +0,0 @@ ---- -title: ပထမဆုံး Form -slug: Learn/Forms/Your_first_form -translation_of: Learn/Forms/Your_first_form -original_slug: Learn/HTML/Forms/Your_first_form ---- -
{{LearnSidebar}}{{NextMenu("Learn/Forms/How_to_structure_a_web_form", "Learn/Forms")}}
- -

Web form တစ်ခုဖန်တီးဖို့အတွက် ပထမဆုံးအတွေ့အကြုံကို ဆောင်းပါးစီးရီးရဲ့ ပထမဦးဆုံးသော ဒီဆောင်းပါးမှာ ရရှိမှာပါ။,  HTML form controls တွေနဲ့ အခြား HTML elements တွေကိုမှန်ကန်စွာအသုံးချပြီး ရိုးရိုး form တစ်ခုကို ဒီဇိုင်းပုံဖော်ခြင်းနဲ့ လက်တွေ့ရေးဆွဲရပါမယ်။ CSS ကိုသုံးပြီး အဲဒီ Form ကို ရိုးရိုးလေး အလှဆင်တာနည်းနည်းလုပ်ရမယ်။ ဆာဗာကို ဒေတာတွေဘယ်လိုပို့သလဲဆိုတာလည်း လေ့လာရပါမယ်။ အပေါ်မှာပြောခဲ့တာတွေ တစ်ခုချင်းစီကို နောက်ပိုင်းမှာ နည်းနည်းပိုပြီးအသေးစိတ်ရှင်းပြပေးသွားပါမယ်။

- - - - - - - - - - - - -
Prerequisites:Basic computer literacy, and a basic understanding of HTML.
Objective:To gain familiarity with what web forms are, what they are used for, how to think about designing them, and the basic HTML elements you'll need for simple cases.
- -

What are web forms?

- -

Web forms are one of the main points of interaction between a user and a web site or application. Forms allow users to enter data, which is generally sent to a web server for processing and storage (see Sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a UI feature).

- -

A web form's HTML is made up of one or more form controls (sometimes called widgets), plus some additional elements to help structure the overall form — they are often referred to as HTML forms. The controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio buttons, and are mostly created using the {{htmlelement("input")}} element, although there are some other elements to learn about too.

- -

Form controls can also be programmed to enforce specific formats or values to be entered (form validation), and paired with text labels that describe their purpose to both sighted and blind users.

- -

Designing your form

- -

Before starting to code, it's always better to step back and take the time to think about your form. Designing a quick mockup will help you to define the right set of data you want to ask your user to enter. From a user experience (UX) point of view, it's important to remember that the bigger your form, the more you risk frustrating people and losing users. Keep it simple and stay focused: ask only for the data you absolutely need.

- -

Designing forms is an important step when you are building a site or application. It's beyond the scope of this article to cover the user experience of forms, but if you want to dig into that topic you should read the following articles:

- - - -

In this article, we'll build a simple contact form. Let's make a rough sketch.

- -

The form to build, roughly sketch

- -

Our form will contain three text fields and one button. We are asking the user for their name, their e-mail and the message they want to send. Hitting the button will send their data to a web server.

- -

Active learning: Implementing our form HTML

- -

Ok, let's have a go at creating the HTML for our form. We will use the following HTML elements: {{HTMLelement("form")}}, {{HTMLelement("label")}}, {{HTMLelement("input")}}, {{HTMLelement("textarea")}}, and {{HTMLelement("button")}}.

- -

Before you go any further, make a local copy of our simple HTML template — you'll enter your form HTML into here.

- -

The {{HTMLelement("form")}} element

- -

All forms start with a {{HTMLelement("form")}} element, like this:

- -
<form action="/my-handling-form-page" method="post">
-
-</form>
- -

This element formally defines a form. It's a container element like a {{HTMLelement("section")}} or {{HTMLelement("footer")}} element, but specifically for containing forms; it also supports some specific attributes to configure the way the form behaves. All of its attributes are optional, but it's standard practice to always set at least the action and method attributes:

- - - -
-

Note: We'll look at how those attributes work in our Sending form data article later on.

-
- -

For now, add the above {{htmlelement("form")}} element into your HTML {{htmlelement("body")}}.

- -

The {{HTMLelement("label")}}, {{HTMLelement("input")}}, and {{HTMLelement("textarea")}} elements

- -

Our contact form is not complex: the data entry portion contains three text fields, each with a corresponding {{HTMLelement("label")}}:

- - - -

In terms of HTML code we need something like the following to implement these form widgets:

- -
<form action="/my-handling-form-page" method="post">
- <ul>
-  <li>
-    <label for="name">Name:</label>
-    <input type="text" id="name" name="user_name">
-  </li>
-  <li>
-    <label for="mail">E-mail:</label>
-    <input type="email" id="mail" name="user_email">
-  </li>
-  <li>
-    <label for="msg">Message:</label>
-    <textarea id="msg" name="user_message"></textarea>
-  </li>
- </ul>
-</form>
- -

Update your form code to look like the above.

- -

The {{HTMLelement("li")}} elements are there to conveniently structure our code and make styling easier (see later in the article). For usability and accessibility, we include an explicit label for each form control. Note the use of the for attribute on all {{HTMLelement("label")}} elements, which takes as its value the id of the form control with which it is associated — this is how you associate a form control with its label.

- -

There is great benefit to doing this — it associates the label with the form control, enabling mouse, trackpad, and touch device users to click on the label to activate the corresponding control, and it also provides an accessible name for screen readers to read out to their users. You'll find further details of form labels in How to structure a web form.

- -

On the {{HTMLelement("input")}} element, the most important attribute is the type attribute. This attribute is extremely important because it defines the way the {{HTMLelement("input")}} element appears and behaves. You'll find more about this in the Basic native form controls article later on.

- - - -

Last but not least, note the syntax of <input> vs. <textarea></textarea>. This is one of the oddities of HTML. The <input> tag is an empty element, meaning that it doesn't need a closing tag. {{HTMLElement("textarea")}} is not an empty element, meaning it should be closed with the proper ending tag. This has an impact on a specific feature of forms: the way you define the default value. To define the default value of an {{HTMLElement("input")}} element you have to use the value attribute like this:

- -
<input type="text" value="by default this element is filled with this text">
- -

On the other hand,  if you want to define a default value for a {{HTMLElement("textarea")}}, you put it between the opening and closing tags of the {{HTMLElement("textarea")}} element, like this:

- -
<textarea>
-by default this element is filled with this text
-</textarea>
- -

The {{HTMLelement("button")}} element

- -

The markup for our form is almost complete; we just need to add a button to allow the user to send, or "submit", their data once they have filled out the form. This is done by using the {{HTMLelement("button")}} element; add the following just above the closing </ul> tag:

- -
<li class="button">
-  <button type="submit">Send your message</button>
-</li>
- -

The {{htmlelement("button")}} element also accepts a type attribute — this accepts one of three values: submit, reset, or button.

- - - -
-

Note: You can also use the {{HTMLElement("input")}} element with the corresponding type to produce a button, for example <input type="submit">. The main advantage of the {{HTMLelement("button")}} element is that the {{HTMLelement("input")}} element only allows plain text in its label whereas the {{HTMLelement("button")}} element allows full HTML content, allowing more complex, creative button content.

-
- -

Basic form styling

- -

Now that you have finished writing your form's HTML code, try saving it and looking at it in a browser. At the moment, you'll see that it looks rather ugly.

- -
-

Note: If you don't think you've got the HTML code right, try comparing it with our finished example — see first-form.html (also see it live).

-
- -

Forms are notoriously tricky to style nicely. It is beyond the scope of this article to teach you form styling in detail, so for the moment we will just get you to add some CSS to make it look OK.

- -

First of all, add a {{htmlelement("style")}} element to your page, inside your HTML head. It should look like so:

- -
<style>
-
-</style>
- -

Inside the style tags, add the following CSS:

- -
form {
-  /* Center the form on the page */
-  margin: 0 auto;
-  width: 400px;
-  /* Form outline */
-  padding: 1em;
-  border: 1px solid #CCC;
-  border-radius: 1em;
-}
-
-ul {
-  list-style: none;
-  padding: 0;
-  margin: 0;
-}
-
-form li + li {
-  margin-top: 1em;
-}
-
-label {
-  /* Uniform size & alignment */
-  display: inline-block;
-  width: 90px;
-  text-align: right;
-}
-
-input,
-textarea {
-  /* To make sure that all text fields have the same font settings
-     By default, textareas have a monospace font */
-  font: 1em sans-serif;
-
-  /* Uniform text field size */
-  width: 300px;
-  box-sizing: border-box;
-
-  /* Match form field borders */
-  border: 1px solid #999;
-}
-
-input:focus,
-textarea:focus {
-  /* Additional highlight for focused elements */
-  border-color: #000;
-}
-
-textarea {
-  /* Align multiline text fields with their labels */
-  vertical-align: top;
-
-  /* Provide space to type some text */
-  height: 5em;
-}
-
-.button {
-  /* Align buttons with the text fields */
-  padding-left: 90px; /* same size as the label elements */
-}
-
-button {
-  /* This extra margin represent roughly the same space as the space
-     between the labels and their text fields */
-  margin-left: .5em;
-}
- -

Save and reload, and you'll see that your form should look much less ugly.

- -
-

Note: You can find our version on GitHub at first-form-styled.html (also see it live).

-
- -

Sending form data to your web server

- -

The last part, and perhaps the trickiest, is to handle form data on the server side. The {{HTMLelement("form")}} element defines where and how to send the data thanks to the action and method attributes.

- -

We provide a name to each form control. The names are important on both the client- and server-side; they tell the browser which name to give each piece of data and, on the server side, they let the server handle each piece of data by name. The form data is sent to the server as name/value pairs.

- -

To name the data in a form you need to use the name attribute on each form widget that will collect a specific piece of data. Let's look at some of our form code again:

- -
<form action="/my-handling-form-page" method="post">
- <ul>
-  <li>
-    <label for="name">Name:</label>
-    <input type="text" id="name" name="user_name" />
-  </li>
-  <li>
-    <label for="mail">E-mail:</label>
-    <input type="email" id="mail" name="user_email" />
-  </li>
-  <li>
-    <label for="msg">Message:</label>
-    <textarea id="msg" name="user_message"></textarea>
-  </li>
-
-  ...
-
- -

In our example, the form will send 3 pieces of data named "user_name", "user_email", and "user_message". That data will be sent to the URL "/my-handling-form-page" using the HTTP POST method.

- -

On the server side, the script at the URL "/my-handling-form-page" will receive the data as a list of 3 key/value items contained in the HTTP request. The way this script will handle that data is up to you. Each server-side language (PHP, Python, Ruby, Java, C#, etc.) has its own mechanism of handling form data. It's beyond the scope of this guide to go deeply into that subject, but if you want to know more, we have provided some examples in our Sending form data article later on.

- -

Summary

- -

Congratulations, you've built your first web form. It looks like this live:

- -

{{ EmbedLiveSample('A_simple_form', '100%', '240', '', 'Learn/Forms/Your_first_form/Example') }}

- -

That's only the beginning, however — now it's time to take a deeper look. Forms have way more power than what we saw here and the other articles in this module will help you to master the rest.

- -

{{NextMenu("Learn/Forms/How_to_structure_a_web_form", "Learn/Forms")}}

- -

In this module

- - - -

Advanced Topics

- - diff --git a/files/my/learn/html/index.html b/files/my/learn/html/index.html deleted file mode 100644 index efe1fad267..0000000000 --- a/files/my/learn/html/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: HTML -slug: Learn/HTML -translation_of: Learn/HTML ---- -
{{LearnSidebar}}
- -

To build websites, you should know about {{Glossary('HTML')}} — the fundamental technology used to define the structure of a webpage. HTML is used to specify whether your web content should be recognized as a paragraph, list, heading, link, image, multimedia player, form, or one of many other available elements or even a new element that you define.

- -

သင်ယူမုဆိုင်ရာ လမ်းေကာင်း

- -

Ideally you should start your learning journey by learning HTML. Start by reading Introduction to HTML. You may then move on to learning about more advanced topics such as:

- - - -
-
- -

Before starting this topic, you should have at least basic familiarity with using computers, and using the web passively (i.e. just looking at it, consuming the content). You should have a basic work environment set up as detailed in Installing basic software, and understand how to create and manage files, as detailed in Dealing with files — both are parts of our Getting started with the web complete beginner's module.

- -

It is recommended that you work through Getting started with the web before attempting this topic, however it isn't absolutely necessary; much of what is covered in the HTML basics article is also covered in our Introduction to HTML module, albeit in a lot more detail.

- -

သင်ရိုး

- -

This topic contains the following modules, in a suggested order for working through them. You should definitely start with the first one.

- -
-
Introduction to HTML
-
This module sets the stage, getting you used to important concepts and syntax, looking at applying HTML to text, how to create hyperlinks, and how to use HTML to structure a webpage.
-
Multimedia and embedding
-
This module explores how to use HTML to include multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages.
-
HTML Tables
-
Representing tabular data on a webpage in an understandable, {{glossary("Accessibility", "accessible")}} way can be a challenge. This module covers basic table markup, along with more complex features such as implementing captions and summaries.
-
HTML Forms
-
Forms are a very important part of the Web — these provide much of the functionality you need for interacting with web sites, e.g. registering and logging in, sending feedback, buying products, and more. This module gets you started with creating the client-side parts of forms.
-
- -

 HTML ပသနာများ ေဖရင်းခင်း

- -

Use HTML to solve common problems provides links to sections of content explaining how to use HTML to solve very common problems when creating a webpage: dealing with titles, adding images or videos, emphasizing content, creating a basic form, etc.

- -

ပိုမိုလေ့လာရန်

- -
-
-
HTML (HyperText Markup Language) on MDN
-
The main entry point for HTML documentation on MDN, including detailed element and attribute references — if you want to know what attributes an element has or what values an attribute has, for example, this is a great place to start.
-
-
diff --git a/files/my/learn/index.html b/files/my/learn/index.html deleted file mode 100644 index 367d375f74..0000000000 --- a/files/my/learn/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: Web developement အကြောင်းလေ့လာခြင်း -slug: Learn -tags: - - Beginner - - Index - - Landing - - Learn - - Web -translation_of: Learn ---- -
-

vbnကိုယ်တိုင် website တစ်ခု ဒါမှမဟုတ် web app တခုဖန်တီးချင်တယ်ဟုတ်။ ဒီနေရာကသင့်ကိုစောင့်နေပါတယ်။

-
- -

web design နဲ့ development အတွက် သင်ယူစရာတွေများပပြားလှပါတယ်။ ဒါပေမဲ့ စိတ်မပူပါနဲ့ ။ ကျွန်တော်တို့ သင့်ကို professional web developer တယောက်အဖြစ်ရပ်တည်နိုင်လာအောင် ကူညီလမ်းပြပေးမှာပါ။

- -

ဘယ်​နေ​အစ​ပြုချင်လဲ

- -

ခ​င်​ဗျားနဲ့ ကျွန်တော်တို့တော့ ဆုံကြပြီ၊ ဘယ်အကြောင်းအရာကိုခ​င်ဗျားလေ့လာချင်ပါသလဲ။

- - - -
-

Note: In the future, we're planning to publish more learning pathways, for example for experienced coders learning specific advanced techniques, native developers who are new to the Web, or people who want to learn design techniques.

-
- -

{{LearnBox({"title":"Quick learning: Vocabulary"})}}

- -

Learning with other people

- -

If you have a question or are still wondering where to go, Mozilla is a global community of Web enthusiasts, including mentors and teachers who are glad to help you. Get in touch with them through WebMaker:

- - - -

Sharing knowledge

- -

This whole Learning Area is built by our contributors. We need you in our team whether you are a beginner, a teacher, or a skilled web developer. If you're interested, take a look at how you can help, and we encourage you to chat with us on our mailing lists or IRC channel. :)

- - - -
    -
  1. Web နှင့်အစပြုကြရအောင်
  2. -
  3. Web အကြောင်းသိကောင်းစရာ -
      -
    1. Web Literacy Map
    2. -
    3. Web mechanics
    4. -
    5. Infrastructure
    6. -
    7. Coding & Scripting
    8. -
    9. Design & Accessibility
    10. -
    11. Writing & planning
    12. -
    -
  4. -
  5. နည်းပညာများ လေ့လာမယ် -
      -
    1. HTML
    2. -
    3. CSS
    4. -
    5. JavaScript
    6. -
    7. Python
    8. -
    -
  6. -
  7. သင်ခန်းစာများနှင့် လေ့လာမယ် -
      -
    1. Website တစ်ခုဘယ်လိုတည်ဆောက်မလဲ
    2. -
    3. Information security အခြေခံ
    4. -
    -
  8. -
  9. သင်ယူမှုအရင်းအမြစ်များရယူရန်
  10. -
  11. အကူအညီရယူရန် -
      -
    1. FAQ
    2. -
    3. Glossary
    4. -
    5. Ask your questions
    6. -
    7. Meet teachers and mentors
    8. -
    -
  12. -
  13. ကျွန်တော်တို့ကို ကူညီ ထောက်ပံပါ
  14. -
diff --git a/files/my/learn/javascript/index.html b/files/my/learn/javascript/index.html deleted file mode 100644 index 2e6649a258..0000000000 --- a/files/my/learn/javascript/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: JavaScript -slug: Learn/JavaScript -tags: - - Beginner - - CodingScripting - - JavaScript - - JavaScripting beginner - - Landing - - Module - - NeedsTranslation - - Topic - - TopicStub - - 'l10n:priority' -translation_of: Learn/JavaScript ---- -
{{LearnSidebar}}
- -

{{Glossary("JavaScript")}} is a programming language that allows you to implement complex things on web pages. Every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, or interactive maps, or animated 2D/3D graphics, or scrolling video jukeboxes, and so on — you can bet that JavaScript is probably involved.

- -

Learning pathway

- -

JavaScript is arguably more difficult to learn than related technologies such as HTML and CSS. Before attempting to learn JavaScript, you are strongly advised to get familiar with at least these two technologies first, and perhaps others as well. Start by working through the following modules:

- - - -

Having previous experience with other programming languages might also help.

- -

After getting familiar with the basics of JavaScript, you should be in a position to learn about more advanced topics, for example:

- - - -

Modules

- -

This topic contains the following modules, in a suggested order for working through them.

- -
-
JavaScript first steps
-
In our first JavaScript module, we first answer some fundamental questions such as "what is JavaScript?", "what does it look like?", and "what can it do?", before moving on to taking you through your first practical experience of writing JavaScript. After that, we discuss some key JavaScript features in detail, such as variables, strings, numbers and arrays.
-
JavaScript building blocks
-
In this module, we continue our coverage of all JavaScript's key fundamental features, turning our attention to commonly-encountered types of code block such as conditional statements, loops, functions, and events. You've seen this stuff already in the course, but only in passing — here we'll discuss it all explicitly.
-
Introducing JavaScript objects
-
In JavaScript, most things are objects, from core JavaScript features like strings and arrays to the browser APIs built on top of JavaScript. You can even create your own objects to encapsulate related functions and variables into efficient packages. The object-oriented nature of JavaScript is important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you. Here we teach object theory and syntax in detail, look at how to create your own objects, and explain what JSON data is and how to work with it.
-
Client-side web APIs
-
When writing client-side JavaScript for web sites or applications, you won't go very far before you start to use APIs — interfaces for manipulating different aspects of the browser and operating system the site is running on, or even data from other web sites or services. In this module we will explore what APIs are, and how to use some of the most common APIs you'll come across often in your development work. 
-
- -

Solving common JavaScript problems

- -

Use JavaScript to solve common problems provides links to sections of content explaining how to use JavaScript to solve very common problems when creating a webpage.

- -

See also

- -
-
JavaScript on MDN
-
The main entry point for core JavaScript documentation on MDN — this is where you'll find extensive reference docs on all aspects of the JavaScript language, and some advanced tutorials aimed at experienced JavaScripters.
-
Coding math
-
An excellent series of video tutorials to teach the math you need to understand to be an effective programmer, by Keith Peters.
-
-- cgit v1.2.3-54-g00ecf