How could I select the whole text of an input immediately after the onChange action - input

I'm trying to select the whole text of the input HTML tag after an onChange action, but there is a delay. How could I do it without it delay?

Related

Appsmith to change the default value of the Input Box

The Process
I am going to use Appsmith to edit the item price using rest API
The Item List Table
Code
{{menitems.data.content}}
Explanation
From the Image, I have been Displaying my Item with the Edit Button in a table that I got from Rest API
While Clicking I have been showing Item's details and the price to be changed
While Clicking the Edit Price Button
I have been Passing the Price from Table to the javascript object which I have been using storevalue to store the price which I will get the price and show in the popup
Code for Passing Table data to the Javascript Object
{{priceCalculation.openModal(currentRow.pricetype,currentRow.price)}}
Description
I have been passing the price from the table to the popup using the above code
Javascript Object code Open a Modal and storeValue
openModal:(price) => {storeValue("price",price);}
Description
Then in the Javascript object, I have been using storeValue to save in a local storage
The Modal Popup
Explanation
As you can see I have been getting the price from storeValue and adding in the input box's Default Value
In the Popup Price Input
{{appsmith.store.pricebefore}}
Description
From the above code I have been adding the price from the store value
Problem
When I change the text it rolls back the value from the storeValue
For Example
price in storeValue = 300
if I tried to change the price input to = 200
then the input price rolls back to = 300
Solution Tried
in the price Input onTextChanged
{{(function({storeValue("pricebefore",price_before_discount.text);priceCalculation.price_before_change(price_before_discount.text);})()}}
Description
In the above code I have to change the text in storeValue too but it's way too slow if I edit too fast like double clear and add text way fast then it's taking too much time to reflect by the time it reflects it's rolling back the value in storeValue
For Example:
The Text in Input = 12345
if I press double bacspace then it's too slow it only clears one
in the price input onSubmit
If I use this it's working fine on Desktop but on mobile I can't
submit the Input there is no Tick button on keyboard
Conclusion
I just need an alternative using the process of getting the price from the table and putting in the input and allowing the user to edit that input without interference

Telegraf.js store text into user's input field

I'm interested in is it possible to put some text into user's input field in telegram?
Like, you press some button or send a command and bot adds some text template into your input field.
Template example:
Project:
Priority:
Etc.

dojo form submit on change of value

I have a dojo table container embedded within dojo form. I'm able to validate all dijits like textbox, combobox etc and submit the form. But what I need is, submit the form only when a value is changed i.e. if a textbox value is changed, submit the form else don't.
Add a hidden text input field which is empty while loading page. Then After you make a change in your text field check the content in the hidden text field and your respective text field if they are same then don't submit the form.
Dojo input fields maintain the original value in the private attribute of '_resetValue'. Before submitting the form, you can check whether _resetValue is different from .get('value') and submit the data..
If all the attributes are under the Table container, you can fetch the children of the table containers and verify using array.every() function..
var unmodified = array.every(container.getChildren(), function(widget){
return widget._resetValue == widget.get('value');
});

Formatting Dojo TextBox on the fly

I want to format the value of any type of TextBox, based on a pattern, on the fly. So basicly I mean when the user is typing '123' and my pattern is '0.00' it has to be converted directly to '1.23'. I know I can do this with the onChange function, but I guess there is already a Dojo based solution(not the onChange of a TextBox). Could someone tell me which property I have to use?
I've tried to use constraints and filter, but both only work after a blur event.
Widgets fire events on themselves that emulate the events of their DOM elements. For example a text box dijit will fire a change event on the object called "change".
There is also an replaceable function called "format" which, as the name suggests, formats the value of the text box.
see: http://dojotoolkit.org/api/?qs=1.9/dijit/form/_TextBoxMixin
As such you can do:
widget.format = function(value, constraints){ //my formatting fnc}
widget.on('change', function(){
widget.format();
});

Populating label from user input on another form

I have populated a label in VB.Net using what has been input in a text box on another form however, when i then try and use the content of that label in a piece of code, it shows that there is nothing in the label?