Possible to have multiple textfields in React Native AlertIOS api? - javascript

Is there a way to use React Native's AlertIOS api to have an alert with multiple textfields? It seems like the prompt function only allows for one.
And if there isn't a way to have multiple textfields, how would I go about adding this functionality to an alert?
Any help would be much appreciated! Thanks!

I assume you would like multiple plain text input fields in your Alert? If so, it is not possible with vanilla React Native. If you look at the source code here and here, you'll see that only plain-text, secure-text or login-password are the available configurations. But if you really want multiple text fields in an Alert box (without considering not-so-great UX) , you could create a native module and do something like this.

Related

Word ribbon customization of native Office commands

I'm trying to figure out if it's possible to customize Ribbon in Word programatically using Word JavaScript API. I went through the documentation and couldn't figure it out. I'm also curious if it's even possible right now.
What I'd like to achieve is to disable one of the items within Revision Tab. There's a property on the Office object called Office.ribon, which provides requestUpdate(input) method, which should enable this kind of functionality. Although it looks like the RibbonApi is not fully supported yet in Word as stated in the documentation. https://learn.microsoft.com/en-us/office/dev/add-ins/reference/requirement-sets/ribbon-api-requirement-sets
Is there any alternative how to achieve this goal? It might be possible to do it in manifest.xml, but I'm not sure how to get the specific ID of that item. Only IDs of those top-level Tabs are documented, but not their buttons, dropdowns, etc. It also looks like it's only possible to customize only my own custom items, where I specify the ID by myself. Is it also possible to edit a state of those native Office components, like disabling a button within a Tab?
It seems like a basic operation which could already be a part of the API. Can anybody confirm that it's really impossible to do it so far or is there some kind of a workaround at least?
Thank you.
There is currently no way to programmatically change the ribbon in Word. We are working on enhanced ribbon customization, but I would not expect them to be available in Word before mid-2021 and they may not include the option of disabling a built-in ribbon button.

how handle forms Reactjs

Which is the best way to handle a form in react?
I'm starting with react, and when I search how handle forms the options that I found are by refs or with states, and events to update state and it is fine but when there are more than 10 fields? I need to get the value of each input to build a JSON because I'm working with an API.
Then which is the best way to handle a form in react? JavaScript? jQuery?
and even if a need to hide and show elements and other things.
You might want to consider using some library to handle your form e.g https://github.com/jaredpalmer/formik

Prompt an input box in atom electron?

I am very new (couple of days) to HTML/JAVASCRIPT etc and I have started learning UI design with electron. I know how to create buttons and can handle what they do when pressed.
What I could not find is a way to input something in electron js.
For example I want an input field where I will type a number and a button next to it, that when clicked should save this number for other uses. In normal Javascript on a browser I know how to do this, in fact a simple "prompt" can also serve my purpose, but unfortunately even prompt doesn't work on electron ! What is the simplest way to achieve what I am trying to achieve here ?

ExTJS: how to get all components that are clickable and editable(buttons,triggers,textfields and so on)?

My greetings for everyone!
Currently I need to make my ExtJS app so that it is managed by keyboard . Probably I made it, but the result is not satisfied. So, If you know how to resolve my problem I will be very glad when you write your solution here.
But now I am trying to make it by another way. My question is:
ExTJS: how to get all components that are clickable and editable(buttons,triggers,textfields and so on)?
with respect,
A.
You can use view.query('.field, .button') to get buttons and fields on your view

Programmatically trigger copy menu in iOS safari using javascript?

I'm trying to implement a user-friendly way to copy some text from a text input field to the clipboard on iOS/Safari. I understand there is no way to programmatically do it on this platform, but I was hoping I could guide the user experience as much as possible.
On iOS/Safari, when a user manually highlights some text, a contextual Copy menu pops up. I was hoping the same menu would pop up when the text is selected programmatically, but it doesn't. Is it even possible to do that?
If not, any advice on how to best implement a user-friendly experience to copy some text to the clipboard on iOS/Safari?
For reference, I'm selecting the text using the method described in this question:
Programmatically selecting text in an input field on iOS devices (mobile Safari)
It's not possible unfortunately. I'd include some informative text below the input, hopefully that will work out okay in terms of user-friendliness.
Another option would be to go native, e.g. by wrapping using PhoneGap, but I guess you are already well aware of that option. If so, something like this would work in native code:
[UIPasteboard generalPasteboard].string = #"your string";
From javascript it is possible with the help of iOS (objective C).
var getVal = $("#textid").val();
localStorage.setItem("getVal",getVal);
and then you can use your native code for getting this value from local storage.
I haven't knowledge of objective C but you can use that's method after js code.

Categories

Resources