diff --git a/2-ui/4-forms-controls/2-focus-blur/article.md b/2-ui/4-forms-controls/2-focus-blur/article.md index d4348d25b..aabb67eac 100644 --- a/2-ui/4-forms-controls/2-focus-blur/article.md +++ b/2-ui/4-forms-controls/2-focus-blur/article.md @@ -1,25 +1,25 @@ -# Focusing: focus/blur +# ফোকাসিং: focus/blur -An element receives the focus when the user either clicks on it or uses the `key:Tab` key on the keyboard. There's also an `autofocus` HTML attribute that puts the focus onto an element by default when a page loads and other means of getting the focus. +কোন এলিমেন্টে ক্লিক বা কি বোর্ডের `key:Tab` প্রেসের মাধ্যমে নেভিগেশনের সময় ফোকাস ইভেন্ট সংগঠিত হয়। এছাড়াও HTML এ `autofocus` নামের একটি অ্যাট্রিবিউট আছে যা পেজ লোড হওয়ার সময় এলিমেন্টকে ফোকাস করে। -Focusing on an element generally means: "prepare to accept the data here", so that's the moment when we can run the code to initialize the required functionality. +কোন এলিমেন্টে ফোকাস বলতে বুঝায়: "এটির মধ্যে ডাটা যোগ করা সম্ভব", সুতরাং এর দ্বারা বোঝায় এলিমেন্টটিতে ডাটা নেয়ার জন্য প্রস্তুত। -The moment of losing the focus ("blur") can be even more important. That's when a user clicks somewhere else or presses `key:Tab` to go to the next form field, or there are other means as well. +যখন কোন এলিমেন্ট ফোকাস হারায় তখন তাকে বলে ("blur") এবং এটি সম্পর্কেও জেনে রাখা গুরুত্বপূর্ন। যখন ইউজার অন্য কোথাও ক্লিক করে অথবা `key:Tab` প্রেস করে তখন এটি সংগঠিত হয়। -Losing the focus generally means: "the data has been entered", so we can run the code to check it or even to save it to the server and so on. +ফোকাস হারানো দ্বারা বুঝায়: "ডাটা সংযুক্ত করা হয়েছে", সুতরাং আমরা কোডের মাধ্যমে ডাটা যাচাই বাছাই করে তা সার্ভারে পাঠাতে পারি। -There are important peculiarities when working with focus events. We'll do the best to cover them further on. +ফোকাস ইভেন্ট নিয়ে কাজ করার সময় আমরা কিছুটা ব্যতিক্রম ব্যপার দেখব। তবে এই অধ্যায়ে আমরা এই নিয়ে বিস্তারিত আলোচনা করব। -## Events focus/blur +## ইভেন্টস focus/blur -The `focus` event is called on focusing, and `blur` -- when the element loses the focus. +যখন কোন এলিমেন্টকে ফোকাস করা হয় তখন `focus` ইভেন্ট সংগঠিত হয়, এবং যখন এলিমেন্ট ফোকাস হারায় তখন `blur` ইভেন্ট সংগঠিত হয়। -Let's use them for validation of an input field. +চলুন ভ্যালিডেশনের জন্য এদের ব্যবহার করি। -In the example below: +নিচের উদাহরণে: -- The `blur` handler checks if the field has an email entered, and if not -- shows an error. -- The `focus` handler hides the error message (on `blur` it will be checked again): +- `blur` হ্যান্ডেলার চেক করবে ইনপুট কি ইমেইল? যদি না হয় তাহলে এরর দেখাবে। +- আবার অই ফিল্ডে ফোকাস হলে `focus` হ্যান্ডেলার এরর মেসেজ হাইড করবে (এবং যদি ফোকাস হারায় আবারো `blur` হ্যান্ডেলার কল হবে): ```html run autorun height=60 ``` -The order is like this: `1 - 2 - 0`. Normally, `