ui.Textbox.onChange
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह एक कॉलबैक रजिस्टर करता है. इसे तब कॉल किया जाता है, जब टेक्स्ट बॉक्स में मौजूद टेक्स्ट बदलता है.
खास तौर पर, कॉलबैक तब कॉल किया जाता है, जब:
- उपयोगकर्ता नई वैल्यू टाइप करता है और फिर टेक्स्ट बॉक्स से फ़ोकस हट जाता है या उपयोगकर्ता Enter दबाता है.
- set('value', newValue) का इस्तेमाल करके, प्रोग्राम के हिसाब से नई वैल्यू सेट की जाती है.
यह एक ऐसा आईडी दिखाता है जिसे unlisten() को पास किया जा सकता है, ताकि कॉलबैक को अनरजिस्टर किया जा सके.
इस्तेमाल | रिटर्न |
---|
Textbox.onChange(callback) | स्ट्रिंग |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: ui.textbox | ui.Textbox | ui.Textbox इंस्टेंस. |
callback | फ़ंक्शन | टेक्स्ट में बदलाव होने पर, इस फ़ंक्शन को कॉल किया जाता है. कॉलबैक को, टेक्स्ट बॉक्स में मौजूद टेक्स्ट और टेक्स्ट बॉक्स विजेट पास किया जाता है. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eTriggers a function when the textbox content is modified, either by user input or programmatically.\u003c/p\u003e\n"],["\u003cp\u003eThe registered function receives the current text and the textbox widget as arguments.\u003c/p\u003e\n"],["\u003cp\u003eProvides a method to unregister the function using a unique ID returned during registration.\u003c/p\u003e\n"],["\u003cp\u003eText change is triggered by user input (typing followed by focus loss or pressing Enter), or by programmatically setting a new value.\u003c/p\u003e\n"]]],[],null,["# ui.Textbox.onChange\n\n\u003cbr /\u003e\n\nRegisters a callback that's called when text in the textbox changes.\n\n\u003cbr /\u003e\n\nIn particular, the callback is called when:\n\n- The user types a new value and then either the textbox loses focus or the user presses enter.\n\n- A new value is set programmatically with set('value', newValue).\n\nReturns an ID which can be passed to unlisten() to unregister the callback.\n\n| Usage | Returns |\n|------------------------------|---------|\n| Textbox.onChange`(callback)` | String |\n\n| Argument | Type | Details |\n|--------------------|------------|------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.textbox` | ui.Textbox | The ui.Textbox instance. |\n| `callback` | Function | The callback to fire when the text changes. The callback is passed the text currently in the textbox and the textbox widget. |"]]