تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يخزِّن حقل إدخال نصي سلسلة كقيمة له وسلسلة أخرى كنصه. وتكون قيمة
هذا الحقل دائمًا سلسلة صالحة، في حين يمكن أن يكون نصه أي سلسلة يتم إدخالها في
محرر الحقل.
حيث يكون FIELDNAME سلسلة تشير إلى حقل إدخال نصي، و
القيمة هي القيمة التي سيتم تطبيقها على الحقل. تتبع القيمة
القواعد نفسها المتّبعة في قيمة الدالة الإنشائية.
XML
يظهر ملف XML الخاص بحقل إدخال نص على النحو التالي:
<fieldname="FIELDNAME">text</field>
حيث تحتوي سمة الحقل name على سلسلة تشير إلى حقل إدخال
نصي، والنص الداخلي هو القيمة التي سيتم تطبيقها على الحقل. تلتزم قيمة
النص الداخلي بالقواعد نفسها المتّبعة في قيمة المنشئ.
التخصيص
التدقيق الإملائي
يمكن استخدام الدالة
setSpellcheck
لتحديد ما إذا كان الحقل يتحقّق من الإملائي لنص الإدخال أم لا.
حقول إدخال النصوص مع التدقيق الإملائي وبدونه
تكون ميزة التدقيق الإملائي مفعَّلة تلقائيًا.
ينطبق ذلك على الحقول الفردية. إذا أردت تعديل جميع الحقول، عليك تغيير الموقع
Blockly.FieldTextInput.prototype.spellcheck_.
إنشاء مدقّق لإدخال النصوص
قيمة حقل إدخال النص هي سلسلة، لذا يجب أن تقبل أي أدوات تحقّق سلسلة
وتعرض سلسلة أو null أو undefined.
في ما يلي مثال على مدقّق يزيل كل أحرف "a" من السلسلة التالية:
تاريخ التعديل الأخير: 2025-06-17 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-06-17 (حسب التوقيت العالمي المتفَّق عليه)"],[[["A text input field stores a string value and allows user text input, with the value always being a valid string."],["You can create text input fields using JSON or JavaScript, customizing them with options like spellcheck and validators."],["Text input fields can be serialized and deserialized using JSON or XML, representing the field name and value."],["The `setSpellcheck` function allows control over individual field spellchecking, while `Blockly.FieldTextInput.prototype.spellcheck_` affects all fields."],["Validators for text input fields accept a string and return a modified string, null, or undefined to enforce specific input rules."]]],["Text input fields store a string as both their value and text, with the value always being a valid string. Creation involves defining the field in JSON or JavaScript, specifying a default text and optional spellcheck. The constructor and JSON allow setting a value, defaulting to an empty string if `null` or `undefined`. Serialization uses JSON and XML, where field names and values are stored. Spellcheck can be toggled, and validators are functions that accept and return strings, `null`, or `undefined`.\n"]]