Mobile platform development. Jquery mobile form

Problem

You have downloaded a cost accounting report and want to show it to management. To do this, you need to compile the data from accounting items - according to management accounting items. You know how accounting and accounting articles relate to each other, but each time preparing such a report manually takes you too much time.

Solution

We will consider this case as a continuation of the previous one. Let's imagine that you created the following directory in Excel:

Fig.2.1. Directory: mapping of BU and CU articles


On the left is a cost item (AC), on the right is a management accounting item (MA). It is important that the cost item appears only once in the first column, otherwise the mapping mechanism will not work correctly.

(By the way, the English word mapping is translated as display or correspondence, so the reference book in in this case- this is something general rule how BU articles are reflected in OU articles).

Fig.2.2. Flat table: cost report (from "Account turnover 20")


Please note that in the 7th column the column “Article TC” has appeared. Opposite each cost item we have placed a management accounting item. This can be done manually, but it is much more convenient to use this tool:

Fig.2.3. Flat table: cost report (from "Account turnover 20")


At the bottom of the form the names of the pages are indicated: “Home” is a flat table that contains cost data (Fig. 2.2), “spr” is a reference book (Fig. 2.1).

The column numbers are indicated at the top of the form. So, in this case, if the data in columns 1 of the directory and 3 of the main page coincide, then the data from the 2nd column of the directory is copied to the 7th column of the main page.

In this form there are also many additional options. For example, you can enable the checkboxes “Attribute #2” and “Attribute #3”, and then transferring data from column 2 of the directory to column 7 of the main page will be possible if the directory and the main page match two or even three details at once.

As a result of such a simple operation using pivot table can be built a whole series various analytical reports, in which one of the sections will include the analyst “Article UU”. For example, like this:

Fig.2.4. Cost report for reinforcement shop


Comparison of mapping with VLOOKUP()

Many users are familiar with and use the VLOOKUP() function in these types of situations. However, the VLOOKUP() function only works well on small volumes data, while this form copes well with processing Excel tables, even if you have, say, 5,000 rows in the reference book, and 300,000 rows on the goav page. Try checking it and you will see that VLOOKUP() fails at such volumes. In addition, the VLOOKUP() function creates a significant load on Excel, forcing it to carry out large amounts of calculations. The mapping form avoids this drawback: it runs once, lasts for a few seconds (for large volumes of minutes) and then no additional loads the Excel file is no longer created.


Part 3: Displaying Data from a Table (LIST Operation)

In the previous part, we looked at the types of relationships (one-to-one, one-to-many, many-to-many), as well as one class Book and its mapping class BookMap. In the second part, we will update the Book class, create the remaining classes and connections between them, as was depicted in the previous chapter in the Database Diagram located above the subheading 1.3.1 Relationships.

Code of classes and mappings (With comments)

Class Book

Public class Book ( //Unique identifier public virtual int Id ( get; set; ) // Title public virtual string Name ( get; set; ) // Description public virtual string Description ( get; set; ) // Rating of the World of Fiction public virtual int MfRaiting ( get; set; ) //Page numbers public virtual int PageNumber ( get; set; ) //Link to the picture public virtual string Image (get; set; ) //Date of book arrival (filter by new items!) public virtual DateTime IncomeDate ( get; set; ) //Genre (Many-to-Many) //Why ISet and not IList? Only one collection (IList) can be selected using JOIN fetch, if more than one collection is needed for JOIN fetching, then it is better to convert them into an ISet public virtual ISet collection Genres ( get; set; ) //Series (Many-to-one) public virtual Series Series ( get; set; ) //Opinion and other (One-to-one) private Mind _mind; public virtual Mind Mind ( get ( return _mind ?? (_mind = new Mind()); ) set ( _mind = value; ) ) //Author (Many-to-many) public virtual ISet Authors ( get; set; ) //Initialize in advance so that a null exception does not occur. public Book() ( //Unordered set (one table cannot contain two exactly identical rows, otherwise it selects one and ignores the other) Genres = new HashSet (); Authors = new HashSet (); ) ) //Mapping class Book public class BookMap: ClassMap ( public BookMap() ( Id(x => x.Id); Map(x => x.Name); Map(x => x.Description); Map(x => x.MfRaiting); Map(x = > x.PageNumber); Map(x => x.Image); Map(x => x.IncomeDate); //Many-to-many relationship HasManyToMany(x => x.Genres) //Cascading rules All - When the object is saved, updated or deleted, all dependent objects are checked and //created/updated/added.Cascade.SaveUpdate() //The name of the intermediate table MUST be the same as the class Genre .Table("Book_Genre"); > x.Authors) .Cascade.SaveUpdate() .Table("Book_Author"); //Many-to-one relationship References(x => x.Series); //One-to-one relationship HasOne(x. => x.Mind).Cascade.All().Constrained();

Public class Author ( public virtual int Id ( get; set; ) //Name-Surname public virtual string Name ( get; set; ) //Biography public virtual string Biography ( get; set; ) //Books public virtual ISet Books ( get; set; ) //Initializing Authors public Author() ( Books=new HashSet (); ) ) // Author Mapping public class AuthorMap: ClassMap ( public AuthorMap() ( Id(x => x.Id); Map(x => x.Name); Map(x => x.Biography); //Many-to-many relationship HasManyToMany(x => x .Books) //Cascade rules All - When an object is saved, updated or deleted, all dependent objects are checked and created/updated/added.Cascade.All() //The owner of the collection is the other end of the relationship (Book) and it will be saved first. . .Inverse() //The name of the intermediate table MUST be the same as the Book class!

Class Genre

Public class Genre ( public virtual int Id ( get; set; ) //Genre name public virtual string Name ( get; set; ) // English name genre public virtual string EngName ( get; set; ) //Books public virtual ISet Books ( get; set; ) //Initializing books public Genre() ( Books=new HashSet (); ) ) //Genre mapping public class GenreMap: ClassMap ( public GenreMap() ( Id(x => x.Id); Map(x => x.Name); Map(x => x.EngName); //Many-to-many relationship HasManyToMany(x => x .Books) //Cascade rules All - When an object is saved, updated or deleted, all dependent objects are checked and created/updated/added.Cascade.All() //The owner of the collection is the other end of the relationship (Book) and it will be saved first. . .Inverse() //The name of the intermediate table MUST be the same as the Book class!

Class Opinion:

Public class Mind ( public virtual int Id ( get; set; ) //My opinion public virtual string MyMind ( get; set; ) //Fantlab's opinion public virtual string MindFantLab ( get; set; ) //Book public virtual Book Book ( get; set; ) ) //Mapping public class MindMap:ClassMap ( public MindMap() ( Id(x => x.Id); Map(x => x.MyMind); Map(x => x.MindFantLab); //One-to-one relationship HasOne(x => x.Book ); ) )

Class Cycle(Series):

Public class Series ( public virtual int Id ( get; set; ) public virtual string Name ( get; set; ) //I created an IList, not an ISet, because other than Book, Series is not associated with anything else, although you can do and ISet public virtual IList Books ( get; set; ) //Initializing books. public Series() ( Books = new List (); ) ) public class SeriesMap: ClassMap ( public SeriesMap() ( Id(x => x.Id); Map(x => x.Name); //One-to-many relationship HasMany(x => x.Books) ////Owner of the collection . the other end of the relation (Book) and it will be saved first.

A little explanation
public virtual ISet Genres(get;set;)
public virtual ISet Authors ( get; set; )

Why ISet , and not, for example, the IList familiar to many ? If we use IList instead of ISet and try to run the project, we won’t notice much of a difference (Tables and classes will be created). But when we add the Genre and Authors tables to the Book LeftJoin class at the same time, and we also try to display non-repeating records from the Book table (Distinct Book.Id) into a view (View), Nhibernate will throw an exception and an error.
Cannot simultaneously fetch multiple bags.
In such cases, we use ISet, especially since sets are intended for this (they ignore duplicate records).

Many-to-many relationship.

NHibernate has the concept of a “main” table. Although the many-to-many relationship between the Book and Author tables is equivalent (An author can have many books, a book can have many authors), Nhibernate requires the programmer to specify the table that is stored second (has a method. inverse()), that is, first a record will be created/updated/deleted in the Book table, and only then in the Author table.
Cascade.All means performing cascading operations on save-update and delete. That is, when an object is saved, updated or deleted, all dependent objects are checked and created/updated/added (Ps. Can be written instead of Cascade.All -> .Cascade.SaveUpdate().Cascade.Delete())
Method.Table("Book_Author"); creates an “intermediate” table “Book_Author” in the database.

Many-to-one, one-to-many relationship.

The.Constrained() method tells NHibernate that a record from the Book table must match a record from the Mind table (the id of the Mind table must be equal to the id of the Book table)

If you now run the project and look at the Bibilioteca database, new tables with already formed connections will appear.

Next, fill the created tables with data...
To do this, we will create a test application that will save data in the database, update and delete it, changing HomeController as follows (We comment on unnecessary sections of the code):
public ActionResult Index() ( using (ISession session = NHibernateHelper.OpenSession()) ( using (ITransaction transaction = session.BeginTransaction()) ( //Create, add var createBook = new Book(); createBook.Name = "Metro2033" ; createBook.Description = "Post-apocalyptic mysticism"; createBook.Authors.Add(new Author ( Name = "Glukhovsky" )); createBook.Genres.Add(new Genre ( Name = "Post-apocalyptic mysticism" )); Series ( Name = "Metro" ); createBook.Mind = new Mind ( MyMind = "Post-apocalyptic mysticism" ); session.SaveOrUpdate(createBook); //Update (By ID) //var series = session.Get (1); //var updateBook = session.Get (1); //updateBook.Name = "Metro2034"; //updateBook.Description = "Dystopia"; //updateBook.Authors.ElementAt(0).Name = "Glukhovsky"; //updateBook.Genres.ElementAt(0).Name = "Dystopia"; //updateBook.Series = series; //updateBook.Mind.MyMind = "11111"; //session.SaveOrUpdate(updateBook); //Delete (By ID) //var deleteBook = session.Get (1); //session.Delete(deleteBook); transaction.Commit(); ) Genre genreAl = null; Author authorAl = null; Series seriesAl = null; Mind mindAl = null; var books = session.QueryOver () //Left Join with table Genres .JoinAlias(p => p.Genres, () => .JoinAlias(p => p.Authors, () => authorAl, JoinType.LeftOuterJoin) .JoinAlias(p => p .Series, () => seriesAl, JoinType.LeftOuterJoin) .JoinAlias(p => p.Mind, () => mindAl, JoinType.LeftOuterJoin) //Remove duplicate table id numbers Book.TransformUsing(Transformers.DistinctRootEntity). List(); return View(books);

A little explanation

  1. var books = session.QueryOver () Select * From Book;
  2. .JoinAlias(p => p.Genres, () => genreAl, JoinType.LeftOuterJoin)- similar to executing a SQL script:
    SELECT *FROM Book
    inner JOIN Book_Genre ON book.id = Book_Genre.Book_id
    LEFT JOIN Genre ON Book_Genre.Genre_id = Genre.id
  3. .TransformUsing(Transformers.DistinctRootEntity)- Similar to executing a SQL script: SELECT distinct Book.Id..., (removes duplicate records with the same id)

Types of associations
.JoinAlias(p => p.Genres, () => genreAl, JoinType.LeftOuterJoin)

  1. LeftOuterJoin - selects all records from the left table ( Book), and then appends the right table records to them ( Genre). If a corresponding entry is not found in the right table, displays it as Null
  2. RightOuterJoin is the opposite of LEFT JOIN - it selects all records from the right table ( Genre), and then appends the left table records to them ( Book)
  3. InnerJoin - selects only those records from the left tables ( Book) which has a corresponding entry from the right table ( Genre), and then joins them with records from the right table

Let's change the representation as follows:

Index view

@model IEnumerable @( Layout = null; ) Index

@Html.ActionLink("Create New", "Create")

@foreach (var item in Model) ( @(string strSeries = item.Series != null ? item.Series.Name: null;) }
@Html.DisplayNameFor(model => model.Name) @Html.DisplayNameFor(model => model.Mind) @Html.DisplayNameFor(model => model.Series) @Html.DisplayNameFor(model => model.Authors) @Html.DisplayNameFor(model => model.Genres) Operations
@Html.DisplayFor(modelItem => item.Name) @Html.DisplayFor(modelItem => item.Mind.MyMind)@Html.DisplayFor(modelItem => strSeries) @foreach (var author in item.Authors) ( string strAuthor = author != null ? author.Name: null; @Html.DisplayFor(modelItem => strAuthor)
}
@foreach (var genre in item.Genres) ( string strGenre = genre!= null ? genre.Name: null; @Html.DisplayFor(modelItem => strGenre)
}
@Html.ActionLink("Edit", "Edit", new ( id = item.Id )) | @Html.ActionLink("Details", "Details", new ( id = item.Id )) | @Html.ActionLink("Delete", "Delete", new ( id = item.Id ))




Having checked all the operations one by one, we will notice that:
  • During the Create and Update operations, all data associated with the Book table is updated (remove Cascade="save-update" or cascade="all" and the associated data will not be saved)
  • When deleting, data is deleted from the Book, Mind, Book_Author tables, but the remaining data is not deleted because they have Cascade="save-update"

Mapping for classes that have inheritance.
How to map classes that have inheritance? Let's say we have this example:
//Class of Two-Dimensional Shapes public class TwoDShape ( //Width public virtual int Width ( get; set; ) // Height public virtual int Height ( get; set; ) ) // Class Triangle public class Triangle: TwoDShape ( // ID number public virtual int Id ( get; set; ) //Type of triangle public virtual string Style ( get; set; ) )

In principle, there is nothing complicated in this mapping; we will simply create one mapping for the derived class, that is, the Triangle table.
//Triangle mapping public class TriangleMap: ClassMap ( public TriangleMap() ( Id(x => x.Id); Map(x => x.Style); Map(x => x.Height); Map(x => x.Width); ) )
After launching the application, the following (empty) table will appear in the Biblioteca database

Tags: Add tags

This article is an announcement of new functionality.
It is not recommended to use the contents of this article to learn new functionality.
Full description new functionality will be provided in the documentation for the corresponding version.
Full list of changes in new version is provided in the v8Update.htm file.

Implemented in version 8.3.11.2867.

We continue to develop the mobile platform, adding functionality that is already available in the platform for personal computers. In addition, we are developing specific platform capabilities that are relevant only for mobile devices. We will now tell you about some of the most important improvements.

Scheduler

The object model of the “mobile” scheduler has not changed, but the ways the user interacts with the scheduler have changed, since the methods for entering information on mobile devices differ from those used in desktop computers.

For example, quick editing element is performed by a single click on the element. A long press brings up the context menu and the appearance of markers that allow you to stretch the element. Dragging is done by long pressing and then moving your finger.

Scrolling the entire planner is done by scrolling with one finger, zooming with two fingers, and so on.

A feature of the current implementation of the “mobile” scheduler is that it does not yet support printing.

Formatted Document

Another “new” object that we have added to the mobile platform is FormattedDocument. From the user's point of view, a “mobile” formatted document differs only in that its editing panel is built into the control itself, and is a logical part of the virtual keyboard. You, as developers, are not required to add it separately to the configuration. The editing panel has a different appearance depending on the type of mobile device (phone or tablet).

Preview of the “mobile” form in the configurator

In the configurator, when developing a form, we added the ability to see how your form will look on a mobile device.

In the command panel you can select an interface option Mobile device, and see what the form will look like in standard orientation.

Here you can rotate your mobile device.


In addition, we have given you the opportunity to choose from large number common devices.


In addition, you can view mobile forms in three different scales:

  • Pixel to pixel- when a mobile device screen pixel corresponds to a window screen pixel preview;
  • Actual size - when the size of the mobile device on the screen corresponds to the geometric dimensions of the device;
  • By window size- when the display scale is selected in such a way that the “mobile” display area fits into the preview window without scrolling.

Batch processing of spreadsheet documents

We have added a number of new objects to the mobile platform that allow you to create packages of displayed documents. This functionality is similar to that found in the PC platform. Thus, you can now, for example, send several documents for printing at once.

Development of deliverable notifications

We have implemented support for the Windows push notification service (WNS, Windows Notification Services). Now you can use the functionality of delivered notifications when running a mobile application on platforms of the Windows family.

We have also reworked the error handling system for sending delivered notifications. In situations where an error was previously thrown as an exception, it is now thrown as a value that you can handle in the built-in language.

Hardware acceleration in the Android operating system

On versions of the Android operating system 4.4.2 and higher, the mobile platform now uses hardware acceleration. This allowed us to increase the interface rendering speed by 1.5 – 3 times.

Ask any adult what item they cannot leave home without, and they will answer you: keys, wallet, mobile phone. With the growth of mobile device manufacturers and the release of new and improved models, it is simply impossible not to succumb to this growing trend.

Data from 2014 shows that in the US alone, 90% of adults have a mobile phone, of which 58% are smartphone owners. 42% of Americans own tablets. In a report, eMarketer predicted that by the end of 2014, people will be using about 1.75 billion smartphones worldwide.

These figures only confirm that mobile devices today have turned from luxury items into our everyday necessity. If in the past, phones were only a communication tool, now we rely on them when we work, relax, or go shopping.

Optimizing forms for mobile devices

The rise of smartphones doesn't just make shopping easier for consumers. This is a welcome addition to the already growing online shopping industry. Over time, not only online, but also offline businesses began to understand the importance mobile phones, along with other promotion channels, in obtaining customers.

Forms feedback play a huge role in online shopping, they are also a core element in the mobile platform. We usually encounter them when we make a purchase and the site asks us to provide specific information such as name, address, telephone number and information about credit card. However, many buyers find filling out forms a tedious task, which can ruin their interest. Additionally, online shoppers tend to face challenges such as lack of time or poor internet connection, which can negatively impact your mobile site's conversion rate.

Listed below are 10 ways to speed up your customers' mobile transaction performance and also make their online shopping experience enjoyable.

1. Include only the most important details in your form.

If you don't have the patience to fill out tons of forms on a web page while you're shopping online, then your customers probably feel the same way. There is a difference between filling out a Full-On form and filling out a simple form to buy something from an online store. Compared to the latter, the first version of the form can be quite annoying, and you risk losing the client when he gets tired of filling out the form, especially if he sees that he needs to provide three different phone numbers.

Make online mobile shopping convenient by providing your customers with a simple yet complete order form. Only ask users for truly important information, such as full name, email address, phone number, shipping information, and credit card information. You can also include a drop-down list of states or countries you ship to, or better yet, have your mobile application requests geolocation from clients. This way, you can get their address quickly and accurately.

2. Use height alignment for labels and input fields.

Smartphones have a limited viewing area compared to PCs, so it is important that you design a shape that maximizes this area. One way to do this is to use vertical alignment for your form fields. You see, when for a form it is used horizontal alignment, there is a possibility that not all the information will fit on the smartphone screen, and the label or input field may be lost. Such order forms can look cumbersome to buyers, which can reduce their interest.

On the other hand, if labels and input fields are positioned vertically, it will be easier for your customers to immediately see the information they are asking for, including what they need to fill out. This will help them be confident in the security of the transaction. This layout will also prevent shoppers from missing any input fields, or worse, filling out the form again.

Plus, it will minimize the visual clutter of your shapes. “What is this” and “More details” buttons can be placed on the mobile version of your website. If these buttons need to be placed on a form, then position them so that customers are not distracted from making a purchase.

3. Use drop-down menus and drop-down lists

Another limitation caused by the limited viewing area on a mobile device is the endless scrolling we have to do to view an entire page or fill out a form. Although scrolling is a common occurrence, smartphone users would prefer to have a quick means of purchasing products online.

Using pull-down menus and drop-down lists can help you reduce the time your customers spend filling out forms. Instead of forcing shoppers to choose from a huge number of options, you can group individual products into categories. Pull-down menus are also useful for linking descriptions of your key products that you want to put on one page. Just remember not to start describing them while the menu is expanding.

4. Use adequate selection lists

In cases where drop-down lists or pull-down menus don't fit your mobile site forms, you have two great options for mobile forms: predictive search input fields and private drop-down lists.

Predictive search input fields allow your customers to search for the product or service they need by keywords, and also displays a list of all similar results. This type of form is ideal in cases where the search is expected to take a long time, or when there are a number of products that do not fall into separate categories. Closed dropdown lists, on the other hand, work well for lists of specific menu items located in in a certain order, for example in alphabetical or chronological order.

5. Easy input data entry

You've probably come across input fields on forms on both web and mobile sites. Sometimes they are divided into 2-3 parts, such as name, address, telephone number. And although this works on sites, on their mobile versions similar use forms are not always appropriate.

More often than not, splitting the input requires mobile shoppers to fill out all three (or two) input fields in order to simply respond to one label. If you're going to overdo it in the same form, your customers may lose interest in the process. In addition, the separation of input data may be perceived ambiguously by clients, or even confuse them. When designing forms for mobile platforms, use simpler input fields instead of splitting them up. For example, instead of having two separate fields for first and last name, use one. This will help your customers complete the form faster.

6. Format your form buttons

The “Confirm” button is last step in online shopping, as well as the most important button on the form. If so, then you should arrange it in such a way that your customers remain involved in the process of filling out the form.

Make the “Confirm” button attractive by setting its width to 1/3 of your form, or by painting it a bright color. And instead of simply using the words “Confirm” or “Submit,” use more eloquent calls to action, such as “Register now” or “Submit your application.”

However, avoid using too much bright colors, or making buttons that move too much because it distracts your customers from clicking. You can use subtle color changes or hovering when a button is pressed, so your customers know they're done with the transaction.

7. Set zoom using the viewport meta tag

Browsing on a mobile device may either suit customers or they may have to keep zooming in on the page, but if they do this accidentally, they may get lost on the page. You will be able to control this using the viewport meta tag in your forms. This will allow your customers to avoid accidentally scaling the page, or worse, losing sight of the form altogether.

8. Provide the ability to save data

Shopping using mobile phones can be challenging task for some clients, because there is a risk of clicking the “Back” button or accidentally reloading the page, and if all the completed information disappears, then your buyer will most likely refuse the transaction. You can avoid this possibility by providing your clients with an “Open in new tab” option when they click on any link outside the form.

Additionally, in cases where users can no longer return to previous pages, provide a warning window with buttons such as “Agree,” “OK,” or “Cancel.” By doing this, you can alert your customers whether their data has been saved on the site or in the browser, and thus help them decide to proceed to checkout.

9. Help clients track their progress

Not all buyers are interested in filling out feedback forms. In this case, it will be useful for you to come up with a way to show clients that they are almost at the very end of filling it out. You can do this by placing a loading bar at the top of the form, or by using a simple timeline and percentages to show what step they are at. Remember to limit the number of these steps to save your clients time.

10. Make the form load quickly

Another factor you shouldn't forget is the loading speed of your mobile form. If the page takes a while to load, your customer may be off the hook. The very fact that your users have reached the point of filling out the form shows that they are ready to place an order. Don't disappoint them with poorly loading pages. The loading speed of your forms also depends on the number of elements you put on the page, so be careful when using huge images.

And as always, test your forms on all systems and devices

Nowadays, the variety of mobile devices and their interfaces requires us to design forms for each of them. So, make sure you test your forms against different types mobile devices, taking into account the differences operating systems, sizes and browsers. With testing, you can not only improve your form, but also make sure that it works on all available devices.

In this article, we'll take a look at some of the new form enhancements in HTML5 and analyze how they help improve user interface on mobile. In particular, we'll see how forms can be extended with the additional input types offered by HTML5, and show what you can expect from various mobile browsers.

HTML types 5 Input

HTML5 has a bunch of new input types for forms. These types of inputs allow for greater control and verification of input data. Some of them are especially useful for mobile users who often have difficulties with HTML work Input. The complete list of input data types is given below:

  • color — color selection
  • date — date selection
  • datetime - select date and time
  • email — email mask validation
  • number - enter number
  • range — range slider
  • search - search field
  • tel — phone mask validation
  • time - timing
  • url - URL validation

Of course, this list is not complete. This does not include types that are accepted by the standard, but their essence is not yet clear. We will consider the most popular and relevant of the above types in this article with examples.

1. Input type color

If this input type is supported, the user's browser will invoke the built-in color-picker on the client device. The selected color will be represented in the corresponding hexadecimal RGB value.

< input type = "color" / >

Example of work:

The style of the popup will depend on your browser. Click the button to see how it works.

Choose your color:

Unfortunately, support of this type mobile browsers leaves much to be desired. Of all the existing ones, correct display can only be found in Opera Mobile and Chrome Android. For all other browsers, an empty text field will be shown. This is worth keeping in mind. Alternatively, you can sketch out the palette in JS or use plugins.

2. Input type date

If supported by the browser, it provides a convenient block for selecting a date.

< input type = "date" / >

Example of work:

Date selection:

Note that the input type is Date as well as the options datetime type and datetime-local offer useful attributes, values ​​such as min and max , that can limit and validate user input. We will demonstrate this below in the text.

The HTML Input Date type is supported by almost all browsers. The exceptions are Opera Mini and the default Android browser.

3. Input type datetime and datetime-local

This Input type allows the user to specify the date and time in convenient format. If supported, it will be displayed as a native date/time widget of the device. The difference between these input types is that the first is tied to world time, and the second does not contain any time zone information.

< input type = "datetime-local" / >

Example of work:

Select date and time:

Not supported in IE Mobile and Opera Mini. On other popular browsers (mobile), the type works more or less correctly, but cases of bugs and glitches are not uncommon. Keep this in mind too, and don't forget about JavaScript fallbacks.

4. Input type email

This type requires no representation. Many people already use it and it is supported by almost all browsers.

< input type = "email" / >

Example of work:

Enter your e-mail address:

Before sending, the browser checks the correctness of the filled field and informs the user if the input format is invalid. The calculation is based on the following expression (text)@(domain)

5. Input type number and tel

This is another type that doesn't require much discussion. However, in a mobile environment it is very useful tool. Use it in cases where the user is presented with a set of only numbers. In this situation, he will be offered user-friendly interface numeric keypad.

Example of work:

Select value:

The default range in most browsers is between 0 and 100. That is, the leftmost position of the slider is 0, and the farthest position is 100. You can change the range using the min and max attributes. We can also set the step value through the attribute step. So, to specify a range from 5 to 50, in increments of 5, we would use:

< input type = "range" min = "5" max = "50" step = "5" / >

Support from everyone popular browsers, except Opera Mini.

7. Form validation

It is very convenient to set special HTML Input attribute to validate the input data. For example, we want to create a field that must be filled in: