Implement a dropdown history in a UITextField or similar component - ios

I have a case where users enter a string, and would like the users to be able to quickly select the previously entered, and validated options they have entered before.
Currently the user enters text via a UITextField, ideally I'd like to keep this, or aesthetically this at least, and have a list of the previously validated inputs drop down below, where tapping any of them would fill the UITextView.
Basically I want a dropbox, which is simply filled with previous inputs, but those inputs are not listed on the main UI, only when the user selects the text view.
Can anyone point me towards how to acomplish this?

Related

Google Sheets - Validation list to default on selection in another cell, but still provide drop-down options

I'm stuck on this one, and after a number of google searches am now wondering if I'm the only person who's ever tried to do this.
I have a google sheet that users are required to fill in. There is a drop-down selection option at the top, specifying the region the user needs the file for.
However, as the user gets down to the lines for the individual items required, some (a small number) may not be for the region selected at the top.
So what I'm trying to do is add the regions to the individual lines. The default for each line should be the region selected at the top, so this should show as pre-selected. But I want the user to be able to still click on a drop-down arrow and select a different region for a line.
Does anyone have any ideas on how to do this? Thank you!
Okay,
I'm unsure of your expected outcome, your request is also not very clear -
What I've done is created a list via Data validation, however, if a user enters data into the adjacent column:
https://docs.google.com/spreadsheets/d/1OsrQCUt-Urf_Gx8_l9CBZkaUlDc311-S-0csa9GAtCQ/edit?usp=sharing
also it's good practice to share an example of your workbook for others to edit and work on.
let me know if this is what you wanted.

Click inside UILabel

I'm working with an iOS application. What I'm trying to accomplish,
Let's say the text for the UILabel is "Rikard bla bla bla Rikard".
So in this text I have tagged two people. And when I click on one of them I display a detailed view about that person. So this is working great if I just have one user named Rikard, and it works with multiple too and I can present the detailed view. But my problem is that I don't know which user I clicked on if I have tagged multiple people with the same name. I know I have to go for the ID. Right now I display by name, so it's not that strange that it's not working.
Should I save information in the database in which order the user entered the two tags or how can I ever know who is who?
Please point me in the right direction. The functionality is working great, it's just the logic for who to display when I click. I want to recreate the tagging system that Facebook have when people comment a photo and tag people in it. You can write multiple names there and Facebook will of course know who is who.
ADDED
So what I do when I'm creating my tags. I choose from a list of available tags or I can write them. I will always know which tag to save the current comment with. But the problem occurs when I display them in to different parts,
The first part is just a UILabel with all the tags in a row, separated by blank space. Here I know where the user tapped and I can display the detailed view for the with the name.
The second part is all of the text, I can find where the tags are located, on which line and between what pixels on that line. And I know when I click on them.
But what I need is the logic for clicking two tags with the same name in the same UILabel. Should I somehow save the order of how I saved the tags?
One option that comes to mind is using an NSAttributedString in the label. You may add arbitrary attributes to ranges of text using that class, and its mutable subclass. Thus, you could add a custom attribute to the range of each user's name, and assign for the corresponding value some unique identifier for the user – possibly an NSNumber or NSString that can be used to retrieve the proper information.

Entering/Clearing specific UITextfields?

My aim is to have text boxes - a set amount per level for people to guess a hidden word. I don't want the UITextfield to be tapped and then bring up the keyboard, I'd like to have a different button that brings up the keyboard - if that's possible.
If each box is a separate text field how could I go about entering text. When a user types on the standard apple keypad, how could each character be inputted into a certain text field. I'd preferably like the text to show in the box as soon as a key is tapped.
I'm also having trouble clearing certain letters. Say a user mis-spells something and doesn't realise until the keyboard has resigned as first responder, how could I make it so that a user can tap on maybe two boxes if the rest of the word is spelt right and the program clear it?
Is there any way of writing the program so that it inputs text only if the text field is empty? Continuing with the example above they switch two letters, they tap to clear, they then bring up the keypad and the next key then pressed fills the empty boxes. Not allowing the program to input text in a used text field that only contains a single character?
I'm using Cocos2d - I don't know if that makes a difference. I hope you understand what I mean, although I'm rather bad at explaining.
Thank you in advance for your time and any help :).
Instead of having a textbox that you don't want users to edit, why not use a label?
To show the keyboard, you need to have it linked to some UITextField (or similar). You could use an invisible UITextField, and then monitor the input and send the characters to the correspinding labels. Refer to this question.
To check if a textfield has anything in it:
[textField.text length] > 0, but I would use labels instead of textfields.
I dont really understand the other parts of your question.

Dynamically change certain text in textarea with drop-down selection

I have a text area that has names within the default value. For example the textarea reads..
(dynamic registrant name) just registered to become
a donor in (dynamic from pull-down above)
honor. This text is editable
So in the same form I have an input that asks the user for their name and a select box where they can choose among a selections of names. I am trying to change the names within the text area based on the values they enter in the input and drop-down fields above the text area. Can someone help with this? I am completely stuck. I have read through some of the forums here and it looks like a lot of the solutions are to use ajax. I have zero experience in ajax and would like to find a solution that does not use that...is it possible? Or could someone help with a solution?
I don't think textarea is what you want exactly. What if the user takes off the (dynamic from pull-down above) part? How would you know where to put the text at? Even if you somehow could, I suggest you make regular text input elements for contents that the user can change and put the other dynamically changing text as uneditable html text elements (or however you want to format them).

Submitting all items in a select input, even non-selected items?

I have a form, and the user needs to enter a list of email addresses that will receive a periodic report. I thought a good way to do this would be to have a text input, and buttons to add/remove and clear emails in select box. I used javascript to facilitate the buttons adding/removing and clearing the select box and this works fine. One thing I overlooked is that the select box only returns the selected items, however, in this case I want to return all of them.
Is there a way to return all of the items? One idea I had was to add a hidden input and just add the items in there as well.

Resources