ComputersProgramming

Checkboxes - what is this?

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 at stake. In fact, everything is very simple. Checkboxes are one of the simplest controls when creating forms.

Regular tick

All people met in life with such symbols as a tick, starting from the school's bench. When carrying out testing, you should mark the correct variant with this sign. Then, when filling out the various questionnaires. Well, at the present time, when users make a lot of actions through the Internet, there are no signs at all. Even the simplest registration on any site requires mentioning some points (hobbies, skills).

Also now the Internet is developed. When creating an order, the user marks the items of interest. And often when installing a computer game, you are asked to select additional software. And here, too, you need to make a choice. So, checkboxes are the ones that are used on web pages.

In the creation of sites

Website developers see this element somewhat wider. After all, it's more difficult to create than just click on the square one time and tick the box. Sites are developed using hypertext markup language, which in a professional environment is called only four letters - HTML. And in order to create a tick in it, you need to write a certain code.

How are checkboxes created? HTML has a specialized element (tag), which is a field that has the type "checkbox", which is written like this: .

Principles of operation

Such an element works by the simplest principle: either affirmation or negation. If a check mark is selected in the field, the web browser sends a variable that will send the field name to the server for processing, if the check mark is not checked, the server does not receive anything. An element has an optional attribute with a value value, but it is optional.

Sometimes it happens that on the page some of the checkmarks are already marked. To do this, developers add a special attribute to the tag, which points to the default check mark already set. This attribute is checked, that is, "marked".

Checkboxes are such elements that mean not a single choice from several options, but a mark of all suitable ones. For a developer, this matters, because if one form contains several checkboxes, their names must be different from each other.

Dependent checkboxes

In the case where you need to choose only one option from the set, other elements are used - radio buttons, not flags. But sometimes a type is used, such as dependent checkboxes. 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, because this is somewhat contrary to the very rule of check marking.

Like all tags in HTML, checkboxes are items that have their own characteristics. What are they like? Above, the attribute was already mentioned to pre-check the checked flag. Since in one form the checkboxes must have different names, the name attribute is needed. It just identifies each individual flag. To set the value to be sent to the server, use the value attribute.

It should be noted that the checkboxes are graphical controls that are used primarily in forms. And they work in three modes: not selected, selected and undefined.

Application in Tables

The checkbox is used not only in HTML when developing sites and web applications. Such software, like 1C, also uses this element. After all, the enterprise has a lot of different components and when working with documentation all this must be noted. For example, with the help of the checkbox, you can mark the list of stocks or customers who need to send the goods.

In what other programs does this element apply? Excel - everyone knows this program for compiling tables from Microsoft, which is often an alternative to 1C. The principle of the check box is as follows: if the check mark is checked, then the element returns the true value, if it is checked, it is false. To insert a checkbox in 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 a help or 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. What is the difference between them? To use ActiveX controls, you need a built-in VBA programming language that few people know. And ordinary flags can be immediately linked to a specific cell in the document.

After the checkboxes in Excel are inserted, they are marked by default. When you click the mouse anywhere in the document, the mark is removed. To reverse the selection, click on the check box with the right mouse button, since the left button removes or sets the 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 move the cursor to the corners of the element, you can stretch it to a larger size or reduce it. Special settings allow you to check the box, changing its color, background, frame.

Conclusion

So, as you can see from the above, checkboxes are not a complicated element of the graphical interface, but what everyone encounters in everyday life is an ordinary tick. The concept is slightly different for the programmer and ordinary user, but the essence is the same: it is a control that allows you to make multiple choices when filling out a form. It is important not to confuse checkboxes with radio buttons, which allow you to select only one item from the set.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.unansea.com. Theme powered by WordPress.