Using this script will allow you to analyze the completion of required form fields. Unlike many other form analyzers, in this version the validation is performed on the client side and not on the server side. And only if the required fields are filled in, the entered information is transmitted to the server. If the required fields are not filled in, a message is issued listing the empty fields and the form is not sent to the server.

I used this script when creating the website www.prtut.ru.

Script demo

In the example, all fields are required.

Description

To set required fields in the form, use the arbitrary required attribute, which is specified only for fields that require mandatory input. For example:

The checkRequired() function checks each element in the form for the required attribute. If the attribute is found, then it is checked whether the input was made.

JavaScript

function isEmpty(str) ( // Check for an empty string. for (var intLoop = 0; intLoop

Since the check is performed on the client side, and the script runs directly in the user’s browser, warnings look different in Google Chrome, Mozilla Firefox, Opera and Yandex Browser.

It would seem that there is nothing complicated in the design of input fields: draw empty rectangles for entering data, the user will do the rest himself. However, everything is not so simple. Judging by the length of the article, it is clear that there are quite a lot of rules and features. The user needs to be carefully “guided by the hand”, shown everything, explained and helped. Then and only then will we be able to get the desired data from him. Well, let's start!

7+ input field rules

The most basic rule, as everywhere else, is to put yourself in the place of the visitor. Is everything clear? Is it possible to understand at first glance what needs to be entered in the field? Does the field respond adequately to the information entered?

Write descriptions and tips

Hints and descriptions are needed to show what data needs to be entered, how to enter it correctly, and how the site will use this information in the future.

There are several types of hints:

1) Icons

Icons are a universal visual language. They help you understand what to enter even with a quick glance. And yes, icons are a design fetish =)

However, we should not forget that they always need to be explained.

2) Examples

The easiest way to tell how to fill out a field is to show an example. Sample example: " [email protected]»

3) Explanations

This type of description serves to explain how the site will use the data and what it is needed for. For example: “We need mail to notify you about the status of your order. We will not send spam."

Use masks

For fields that require data formatted in a certain way (for example, a bank card number or phone number), masks should be used. Thus, we shift the work of formatting information from the visitor’s shoulders to a soulless machine.

Here are some examples of different masks:

Highlight required fields

If among the optional fields there are fields that are required to be filled in, then they should be highlighted among others and emphasis should be placed on their mandatory completion. As a rule, required fields are indicated with an asterisk - *.

It is better to group all required fields together and place them at the beginning of the form.

By the way, the example above also shows 2 types of tips: examples and explanations.

Focus and keyboard

The active field in which the cursor is positioned must have a distinctive feature. As a rule, browsers independently highlight active fields. However, you should not leave everything to chance and check the functionality of this function yourself.

When the page loads, the first input field should automatically become active. As if inviting you to fill out the entire form. When filling out a form, it should be possible to switch between input fields without using the mouse. This usually happens by pressing the Tab button.

When using hints with auto-completion (for example, in a search), it should be possible to select an item using arrows and confirm it by pressing the Enter key.

When entering secret data (for example, a password), it should be possible to hide and show this data at the user's request.

Use the data already entered

Input fields need to remember things that ordinary people forget. It is rude to ask for the same information twice. If you once subscribed to the site’s mailing list, then when registering, the site should remember you and enter your email in the appropriate field.

Group input fields

For ease of filling out, it is better to group similar fields together. For example, fields for entering personal information (first name, last name, email) are one block, fields with a delivery address are another block.

Be aware of the field size

The field size in most cases serves to estimate the amount of data that is required from the user. Those. where you need to enter a long address, the field is large. So where a 6-digit index is needed, the field is small.

Finally

The design of input fields is not as simple as it seems at first glance. You need to remember many nuances and constantly ask yourself the question: “will everything be clear to the user?”

Many meticulous guys will say that there weren’t 7 rules at all (and some didn’t even notice, ha ha ha). However, many of the rules are small, so I counted them as half. And in general, I just like the number 7 =)

On almost every website you can see a registration form. Of course, there are those who simply took someone else’s form, inserted it into their own, and then the user wants to register, but cannot. There are cases that during registration a certain password is allowed and you are able to register, but then when you try to log into the site, an error appears that this is an invalid password, and so the site loses a certain number of visitors, so be careful.

A real example can be seen here:

Download

This is not the first lesson on this topic, perhaps you have not seen the previous ones and they will be interesting to you:

HTML part

Let's see what this form consists of:

21 22 23 24 25 26 27 28 29 <form class = "contact_form" action = "#" method = "post" name = "contact_form" > <ul > <li > <h2 > Write to us</h2> <span class = "required_notification" >* fields are required</span> </li> <li > <label for = "name" > Name:</label> <input type = "text" placeholder = "Petrov Alexander" required / > </li> <li > <label for = "email" > Email:</label> <input type = "email" name = "email" placeholder = "name@site" required / > !} <span class = "form_hint" > For example "name@site"</span> </li> <li > <label for = "website" > Web site:</label> <input type = "url" name = "website" placeholder = "https://site" required pattern= "(http|https)://.+" / > !} <span class = "form_hint" > For example "https://site"</span> </li> <li > <label for = "message" > Message:</label> <textarea name = "message" cols = "40" rows = "6" required > </li> <li > <button class = "submit" type = "submit" > Send</button> </li> </ul> </form>

If you have studied past lessons, then you will be familiar with attributes such as placeholder And required.

But I’ll repeat it again:

placeholder— the presence of this attribute means that in the background of this text field there will be the text specified in the value of this attribute. And when you type it disappears.

required— if a field has this attribute, then the field is required.

And we didn't use Javascript because HTML5 allows us to do this with its functions.

There is also a new attribute here pattern="(http|https)://.+"— it specifies what the site’s web address should begin with, otherwise there will be an error.

CSS part

Now we are done with the HTML part and we need to give our form a look. Because all form elements are in an unordered list, therefore using the appropriate selectors will set styles:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .contact_form ul ( width : 750px ; list-style-type : none ; list-style-position : outside ; margin : 0px ; padding : 0px ; ) .contact_form li ( padding : 12px ; border-bottom : 1px solid #eee ; position : relative ; .contact_form li :first-child , .contact_form li :last-child ( border-bottom : 1px solid #777 ; )

The last property means that we set a border to the first and last element of the list. Next, we will define the main styles for form elements:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 .contact_form label ( width : 150px ; margin-top : 3px ; display : inline- block ; float : left ; padding : 3px ; ) .contact_form input ( height : 20px ; width : 220px ; padding : 5px 8px ; ) .contact_form textarea ( padding : 8px ; width : 300px ; ) .contact_form button ( margin-left : 156px ; )

Now let’s write styles for when the fields are active and when they are not:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 .contact_form input, .contact_form textarea ( border : 1px solid #aaa ; box-shadow : 0px 0px 3px #ccc , 0 10px 15px #eee inset ; border-radius : 2px ; padding-right : 30px ; -moz-transition : padding .25s; -webkit-transition : padding .25s; -o-transition : padding .25s; ) .contact_form input:focus , .contact_form textarea:focus ( background : #fff ; border : 1px solid # 555 ; box-shadow : 0 0 3px #aaa ; padding-right : 70px )
1 2 3 4 5 6 7 8 9 10 11 12 13 .contact_form input:required , .contact_form textarea:required ( background : #fff url (images/red_asterisk.png ) no-repeat 98% center ; ) .contact_form input:required :valid , .contact_form textarea:required :valid ( background : #fff url (images/valid.png ) no-repeat 98% center ; box-shadow : 0 0 5px #5cd053 ; border-color : #28921f ; .contact_form input:focus :invalid , .contact_form textarea:focus :invalid ( background : #fff url (images/invalid.png ) no-repeat 98% center ; box-shadow : 0 0 5px #d45252 ; border-color : #b03535 )

Left just a little bit:). The penultimate step is to set styles for tooltips:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 .form_hint ( background : #d45252 ; border-radius : 3px 3px 3px 3px ; color : white ; margin-left : 8px ; padding : 1px 6px ; z-index : 999 ; /* means that the tooltip will overlap all elements */ position: absolute; /* you can split the hint into two lines */ display: none; ) .form_hint : :before ( content : "\25C0 "

;

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 color : #d45252 ;

position: absolute;

top: 1px;

January 13, 2011 at 01:09
  • Interfaces
  • Translation

Web forms play a big role in the daily use of the Internet. If you develop websites, then most likely they are present in them: be it a simple feedback form or a sophisticated web application. Here are some tips to help you create easy-to-use forms.

1. Clearly mark required fields

It's annoying when a user submits a completed form and later finds out that they missed required fields.
It is common practice to mark required fields with an asterisk (*) next to their name. Explicitly indicating whether a field is required or not is a good idea.

On the Zappos.com registration form, required fields are marked with an asterisk (*). Optional fields are also clearly marked.

2. Use clear and detailed error messages

I'm sure you hate it when, when you fill out a form incorrectly, error notifications appear saying, “You must complete all required fields,” instead of providing more detailed information, such as, “You forgot to fill out your email address.”
Using real-time validation of entered data is a good solution. For example, immediately after filling out an email address, the web form should check that the entered format is correct, and if something is wrong, then immediately notify the user.

3. Use client-side data format validation (JavaScript)

Using JavaScript data validation saves the user time and also reduces the load on the web server, freeing it from processing incoming form field values. Client-side validation allows users to see that they have just made an error and not after submitting the form. This is true for any fields that are not linked to your database. Such as checking the format of an email address or the number of digits in a phone number.

The SurveyGizmo registration form lets you know if the email address you entered is not formatted correctly.

4. Visually highlight fields to fill out so that the user doesn’t get lost

Make sure that you can visually determine which field the user is currently filling out. This can be achieved using the focus: pseudo-class selector in CSS.

A Wufoo web form visually highlights active elements with a background color.
At a minimum, implement a highlighted border for fields - browsers will do this for you by default, but make sure the color is different from the site design (background).

Google Chrome highlights the active element with a yellow frame. Firefox light blue.

5. Show progress results

If your web form is large and consists of several pages (or has several steps), make sure that the user is constantly informed about the progress of the actions being performed and how much more time they may need to complete. This often occurs in cases of an online survey (research) with many questions or during the process of placing an order in an online store.
All you have to do is write “Step 4 of 5” or something like that. If users keep clicking the “continue” button without clearly understanding when the last step will be, they will stop filling out the form sooner than you might expect.

The Amazon checkout has 4 pages. The form tells you where you are now and how much time is left until completion.
Of course, a better alternative would be to shorten your web form - if this can't be done, then at least give the user information about how close they are to completing the actions being performed.

6. Periodically save (cache) form data

Forms with multiple pages or steps can often make mistakes. To avoid data loss, you need to implement a way to save user-entered information for each session. This increases the reliability and percentage that the form will be filled out even after situations where the user leaves the page (for example, clicks the back button in the browser). Having to fill out all the form fields again can cause users to leave.

7. Do not use the standard “Submit” text (send)

Instead of having your form button called “Submit,” use text that reminds the user of their actions. For example, “Register”, or better yet, let the user know about the benefits after filling out the form.

On the Basecamp registration form, the “Submit” text has been replaced with something more useful.

8. The “Cancel” button makes you hesitate

Imagine that you are buying a new shirt in a store and the seller asks you: “Do you really want this particular shirt?” Will you still buy it? Most likely no. You may have doubts, thinking that the seller considered the shirt unsuitable.
The same thing happens with web forms: using a “cancel” button can make your users think twice about what they are filling out.

9. Show users fields in the correct format

If you ask users for specific information - such as a phone number or credit card - let them know what you expect. If the password must have a certain number of characters or it must contain a certain set of characters, clearly describe these requirements. This reduces ambiguity and speeds up the filling process.

Geico's registration form provides clear instructions on what format the input data is expected to be in.

10. Single-column form is the best solution

According to eye movement research from user experience design agency cxpartners, scanning a form downwards is preferable to scanning from left to right. This reduces the amount of eye movement needed to complete the form.
Single column form
Backpack's registration form is a single-column form.
Form with multiple columns

POSITION

On holding open team and individual competitions

For powerlifting and naked bench press,

Podolsk and Moscow region

1. Goals and objectives

· Competitions are held to popularize powerlifting in Podolsk and the Moscow region

· Raising a physically developed younger generation and promoting a healthy lifestyle

· Involving young people in systematic physical education and sports

· Creating motivation among adolescents and young people to engage in physical education

· Improving the sportsmanship of athletes in Podolsk and the Moscow region

· Identification of the strongest athletes in Podolsk and the Moscow region

· Formation of a team to perform at open team powerlifting competitions in Podolsk

2. Date and place

The competition is held on November 16, 2013 at the Palace of Culture on May 1: Moscow region, Klimovsk, Zavodskaya street, 3. The start of the competition and weigh-in will be announced additionally (by email or SMS).

3. Organization and leadership

The general organization of the competition is carried out by the MU Center for Civic and Patriotic Education of Youth “Fakel” and the “Good Lift” gym, with the participation of the Podolsk branch of the All-Russian All-Union Organization “Combat Brotherhood” and the “Healthy Nation” Charitable Foundation.



Direct supervision is carried out by the athletic gymnastics coach of the Fakel MU Popov S.A., and the director of the Good Lift gym P.S. Yakovlev. and the representative of the “Healthy Nation” charitable foundation, I.F. Rabotkin.

4. Competition participants

Interested organizations and institutions, as well as individual athletes who have reached the age of 16 and have submitted personal applications to participate in the competition, are invited to participate in the competitions.

The organizers reserve the right to later announce standards for admission to competitions, with mandatory notification of athletes (by email or SMS).

The organizers reserve the right, if the number of applications exceeds, no later than November 9, 2013 to announce standards for admission to competitions, with mandatory notification of athletes by posting information in open sources, as well as sending SMS and e-mail messages.

5. The procedure for holding competitions and conditions for submitting applications

Applications for participation in competitions must be submitted before November 9, 2013 by email: [email protected] or via SMS message to the number +79099250337 (the cost of an SMS is equal to the cost of an SMS message from your telecom operator).

Attention! See Appendix 1 for the correct application form.

6. Procedure for determining the winners

Attention! Competition judging is carried out according to IPF rules (see Appendix 2)

Competitions are held in the open age category (Open).

in the individual championship:

Women compete in the absolute weight category, the winners (who take 1st-2nd-3rd places) are determined by the Wilks formula.

Winners in men are determined in categories up to 75kg, up to 90kg, up to 110kg and over 110 for the best result. Winners in absolute championship (athletes who took 1-2-3 places) in triathlon and bench press are determined according to the Wilks formula.

In the team championship 4 best results of male team members and 1 female result are taken into account

Points are awarded according to the following scheme:

1st place – 6 points

2nd place – 4 points

3rd place – 3 points

4th place – 2 points

5th place – 1 point

The winner of the team championship is the team that scores the maximum number of points among all teams.

7. Winner's reward ceremony

The winners and prize-winners in the individual and team championships who took 1-3 places in the nominations are awarded with commemorative certificates and medals.

8. Financing

The costs associated with organizing, conducting and rewarding the winners are borne by the organizers of the competition, interested organizations and sponsors. Expenses associated with travel and meals for participants are borne by sending organizations. There is no entry fee.

Annex 1

Sample application (sent by email or SMS):

1. nomination: for example, bench press or triathlon.

2. team name or mark personal *

3. Full name *–

4. Year of birth *–

6. digit *–

7. best result * (over the last 6 months) -

8. age* -

9. coach -

10. contact phone number (preferably cell phone)* -

Fields marked with an asterisk are required.

Attention! All participants on the day of the competition must have visas certified by a doctor, and a passport or identity card (licence, military ID). Without these documents, athletes will not be allowed to compete.

Appendix 2

Competition rules:

  1. Performance at competitions takes place without the use of equipment (press shirts, overalls, knee bandages for powerlifting).
  2. You can use: wrist bandages, belts (maximum belt width – 10 cm).
  3. If necessary, you can use a non-supportive bandage (on one leg or arm). Non-supportive bandages are ordinary medical bandages. The bandage must be presented to the judge before use.
  4. Exercises are performed according to IPF rules

Squats(rules and order of execution).

After removing the bar (assistants can provide assistance), the athlete takes the starting position.

After the athlete has accepted the starting position, the judge gives the command to SIT DOWN.

The athlete squats so that the top of the legs at the hip joints is lower than the top of the knees. Only one attempt to make a downward movement is allowed.

The athlete must independently return to a vertical position with legs fully straightened at the knees. Double standing up (“jumping” is prohibited).

As soon as the athlete takes a stationary position, the referee gives the command to return the barbell to the racks - RACKS.

- Prohibited- Failure to comply with the senior referee’s signals when starting or finishing an exercise. Double stand-up (jump) from the bottom of a squat position or any downward movement while standing up. The mistake is to bend the legs at the knees and lower the body to a position where the upper surface of the legs at the hip joints is lower than the top of the knees.

Bench press(rules and order of execution)

The athlete should lie on his back, with his head, shoulders and “whole” buttocks in contact with the surface of the bench. The sole and heels of his shoes must be in contact with the surface of the platform or blocks (as far as the shape of the shoes allows).

The fingers should wrap around the bar lying on the racks, with the thumbs positioned “locked” around the bar. This position must be maintained during

performing the exercise. The use of a reverse grip is prohibited.

To ensure firm support for the legs, the athlete can use flat slabs or blocks no higher than 30 cm from the surface of the platform.

The distance between the hands on the bar, which is measured between the index fingers, should not exceed 81 cm (both index fingers should be inside the 81 cm marks).

After removing the bar from the racks with or without the help of assistants, the athlete must wait for the signal from the senior judge with his arms fully straightened (“on”) at the elbows.

The signal to begin the press must be given as soon as the lifter assumes a stationary position.

position and the bar will be in the correct position. The signal to start the exercise is the command – START.

After receiving the signal, the athlete must lower the barbell to his chest and hold it in a stationary position on his chest (usually the base of the sternum), after which the judge gives the command - PRESS. Then the athlete must press the barbell up into straight arms. After fixing the bar in this position, the judge gives the command - RACKS.

- Prohibited– Any error in following the referee’s commands. Any change in the starting position when performing an exercise (any lifting (separation) of the head, shoulders, buttocks from the bench or movement of the legs on the platform or blocks, or movement of the arms along the bar). Any downward movement of the barbell during a bench press. Lack of squeezing the barbell with fully straightened arms at the end of the exercise.

6. Deadlift (rules and order of execution)

The athlete must face the front of the platform. The barbell, which is located horizontally in front of the athlete’s legs, is held with a free grip with both hands and rises up until the athlete stands upright.

Upon completion of lifting the barbell in the deadlift, the knees should be fully straightened and the shoulders should be pulled back.

The judge gives the command - DOWN.

Any lifting of the barbell or any deliberate attempt to lift it is considered an approach. Once the lift has begun, no downward movement of the barbell is allowed until the lifter reaches a vertical position with the knees fully extended. If the bar sag when the shoulders are pulled back, this is not a reason not to count the weight lifted.

- Prohibited– any downward movement until the final position is reached. Supporting the barbell with your thighs while lifting up. Steps back or forward. Lowering the barbell to the command. Releasing the barbell from your hands when executing the downward command.


Close