All developers of sites, web applications and desktop programs know what checkboxes are. But those people who are far from programming, meeting such an incomprehensible foreign word, do not understand what is being said. In fact, everything is very simple. Checkboxes are one of the simplest controls for creating forms.
Normal checkmark
All people met in life with such symbols as a tick, starting from the school bench. When conducting testing, it is necessary to mark the correct version with this sign. Then, when filling out various questionnaires. Well, at the present time, when users perform many actions through the Internet, there’s nowhere to go without checkmarks. Even the simplest registration on any site requires you to note some points (hobbies, skills).
Internet trading is also now developed. When creating an order, the user notes the items of interest to him. And often when installing a computer game it is suggested to choose additional software. And here, too, you need to make a choice. So, checkboxes are the very checkmarks that are used on web pages.
In the creation of sites
Website developers see this element a little wider. Indeed, it is more difficult to create than just once clicking on the small square with a mouse and ticking off. Sites are developed using the hypertext markup language, which in a professional environment is called just four letters - HTML. And in order to create a checkmark in it, you need to write a certain code.
How are checkboxes created? HTML has a specialized element (tag), which is a field endowed with a “checkbox” type, which is written as follows: <input type = ”checkbox”>.
Principles of operation
Such an element works according to the simplest principle: either affirmation or negation. If a checkmark is checked, the web browser sends a variable that sends the field name to the server for processing, if the checkmark is not checked, the server does not receive anything. An element has an optional attribute with a value of value, but it is optional.
Sometimes it happens that on the page some checkmarks are already checked. To do this, developers add a special attribute to the tag, which indicates the already checked default checkbox. This is the checked attribute, that is, "marked".
Checkboxes are such elements that do not imply a single choice of several options, but a mark of all that apply. This matters to the developer, because if one form contains several checkboxes, their names must be different from each other.
Dependent Checkboxes
In the case when you need to choose only one option from the set, other elements are used - radio buttons, not flags. But sometimes a type such as dependent checkboxes is used. HTML, together with the JavaScript programming language, allows you to make one main flag, on which others depend. When you click on it, several checkboxes can be marked at once. This is rarely used, since it is somewhat contrary to the checkmark rule itself.
Like all tags in HTML, checkboxes are elements that have their own characteristics. What are they like? We have already mentioned the attribute for preliminary marking the checked flag - checked. Since checkboxes must have different names in one form, the name attribute is needed. It just identifies each individual flag. In order to set the value that will be sent to the server, use the value attribute.
It is worth noting that checkboxes are graphic controls that are used primarily in forms. And they work in three modes: not selected, selected and indefinite.
Application in tables
The checkbox is used not only in HTML when developing websites and web applications. Software such as 1C also uses this element. Indeed, the company has many different components and when working with documentation, all this must be noted. For example, using the checkbox, you can mark the list of stocks or customers to whom you want to send the goods.
What other programs use this element? Excel - everyone knows this table compilation program from Microsoft, which is often an alternative to 1C. The principle of operation of the flag is as follows: if the checkmark is checked, then the element returns the true value, if unchecked - false. To insert a checkbox into a document, you need to enable a special tab for the developer. This is done through parameters that are slightly different in each version of Excel.
How to find the necessary settings? There is always help or a search engine. After the tab is enabled, you can insert an item through the "Paste" command of the "Controls" item. Here you need to pay attention to the fact that this menu also contains ActiveX elements located under the necessary form elements. There are also checkboxes there. What is the difference between them? To use ActiveX controls, you need a built-in VBA programming language that few know. And ordinary flags can be immediately tied to a specific cell in the document.
After checkboxes in Excel are inserted, they become checked by default. When you click the mouse anywhere in the document, the mark is removed. For reverse selection, you need to click on the flag with the right mouse button, since the left button removes or sets a checkmark.
When you hover over the checkbox, hold and hold the left button, you can move the item anywhere on the document. It is also convenient to do with the keys on the keyboard. When you hover over the corners of an element, you can stretch it to a larger size or reduce it. Special settings allow you to draw a checkbox by changing its color, background, frame.
Conclusion
So, as can be seen from the above, checkboxes are not a complex element of the graphical interface, but something that everyone faces in everyday life is an ordinary tick. The concept is slightly different for the programmer and the average user, but the essence is the same: it is a control that makes it possible to make multiple choices when filling out any form. It is important not to confuse the checkboxes with the radio buttons, which make it possible to select only one item from the set.