How do I put Fontawesome icons in input "value" fields? - input

I am not using a button for this particular part of the code, only an input field (and any button I added isn't working) but I would like a calculator icon next to the word "Calculate" in the "value" field.
So far I have this:
value=" Calculate"
But this is failing to reproduce the calculator icon (the code does turn blue as though it has been accepted but the icon fails to load).
f1ec is the unicode of the icon at Fontawesome. I can not seem to get a value that works and displays. Is there another way around this or have I done the unicode incorrectly?
Thanks for the help.

Related

ways around broken `TextInput` component in react-native

As far as I can tell by default the react native text input component has some inconsistencies on iOS from the normal text input when using it in a controlled way. The examples I've found so far:
the "period shortcut" (pressing two spaces to get a period in text) does not work.
typing a special character and then space does not switch the keyboard back to its normal mode
spelling errors do not have a red underline
often text replacement shortcuts don't work
I'm trying to get around this in the short term and so far the only thing I've found that works is using a multiline input. At this point I'm trying to "hack" the multiline input to work like a singleline, but figured it was also worth reaching out to see if anyone else has a better solution.

How to use a button to change style of a TextInput

Need to make a button change the color of the font from a TextInput textbox to atleast 4 different colors.
so, i'm quite new in react-native and im having a problem to solve one of my assignments, my teacher asked us to create a button that changes the color of the font inside a Text Input text box to one of 4 different colors presets onPress , couldn't figure it out on my own and cant seem to find any tutorial with this kinda of examples, just found some tutorials that only explain how to change the color from the buttons onPress.
Since you mentioned this is your assignment from your teacher, I would not provide any code, but just a general guideline on how to create the code yourself so that you could try and make it yourself.
What you need to do are :
Create the 4 styles for the text color as const that you can refer to later.
You would also want to have a state to indicate which color you want to show and change it according to the button pressed.
And you would need to pick the correct style from the const made from step 1 above based on the state like shown on this link.
Hope you good luck ini finishing your assignment.

iOS 12 OTP keyboard suggestion

I'm trying to implement the transfer of a one-time code from SMS to the field above the keyboard, as in the image.
But for some reason the field above the keyboard is not displayed.
Code:self.valueTextField.textContentType = UITextContentTypeOneTimeCode;
UI hierarchy:
+UIView
CustomContentView
UIImageView
UITextField - valueTextField
UITextFieldContentView
I have read these materials:soQuestion and apple docs , and I saw a warning:
If you use a custom input view for a security code input text field, iOS cannot display the necessary AutoFill UI.
... but I do not understand what is meant by custom input view.
Also I have category for UITextField. Can it affect the work?
I will be glad to any ideas, thanks!
Okay. This is what I could find out. Regarding the code, it is enough that I described above. Additional settings on the client is not required. But you need to pay attention to the text of the SMS message. As an example, I attached two messages.
In the first message, our code is defined by the system as a phone number. We can even call it if we click on it. But why do we need to call a one-time code? :)
In the second image, the code is defined as one-time, just what we need. If we click on it, the system will offer to copy it to the clipboard.
What is the difference? Unfortunately, it is not completely clear by what rule the text is parsed in SMS. But we can check your text in the following way:
If you set a property textContentType to your text field and nothing works for you, the first thing you need to check is whether the operating system determines the code correctly. To do this, simply go to the message application and check the code:
blue font color with underscore - the system did not recognize
one-time code.
black font color (as default) with a gray underscore - it's okay!
At the end, in the first case, you should check the text of the message for the contents of incorrect characters.
PS Just a couple of examples of correct and incorrect SMS:
SMS-code: 12345 £ correct
SMS-code: 12345 $ correct
SMS-code: 12345 № correct
SMS-code №1: 12345 incorrect
I got caught out by the fact "Autofill PAsswords" was turned off on the phone.
It seems that it needs to be on for this functionaility to work.

Allow JSF input text to be selected at first pass, cursor position

We are seeing odd behavior with JSF inputs that we dont see on regular html input fields.
The field is a search box, and users will commonly swipe the mouse across the field to highlight all existing text, and start overtyping.
You can try this on Google to see what i mean (type a search, leave the field, now clickin on the right side of your entry drag the mouse left - voila, all text is highlighted.)
If we try this exact same process in our JSF app, the cursor just jumps to index 0, and no text is highlighted. Users must repeat the stpe without leaving the field for it to actually highlight the text.
So my question is a) why the difference b) how to work around it
JSF 2.0 (MOjarra)
<h:inputText
class="requiredFields"
id="Search_String"
value="#{searchManager.searchString}"
maxlength="#{searchManager.searchTypeMaxLength()}" />
Turns out this was the result of a hacky implementation of some jQuery validation. Once the faulty library was removed the text box behaves like a text box should!

openWYSIWYG - dynamic positioning

I am making a webpage that has different areas that can be clicked on to change the contents.
I want to set it up so that when you click on an area, an openWYSIWYG editor appears in the middle of the screen with the rest of the page greyed out.
I have achieved this except for the positioning of the editor. When you click on a section I have a div with 50% opacity cover the page and a textarea appear in the middle. But when I try to attach the editor to the textarea, it loses it's position and falls behind the div not in front of it like the textarea is.
Can anyone suggest a way of centring the openWYSIWYG editor?
You're looking for Modal positioning. Here's one solution:
http://jqueryui.com/demos/dialog/#modal-form
Basically, apply the Jquery Dialog to the div that holds your WYSIWYG. Don't forget a submit button.
Just a quick heads up--I went through quite a bit of headache dealing with WYSIWYG editors for client-facing sites a few months back. It seems that clicking the "paste from WORD" button was a very difficult task to figure out. Word-pasted code can wreak havoc on websites, overrunning text fields in the database. I gave it a try on their demo (which also doesn't support webkit based browsers) and the result wasn't pretty. The only two options I found to solve this were to sanitize code on the back end, or to use CKEditor. I chose the latter because it was so easy. Take a look at CK, it's a great piece of free code.