Dynamic moving spans On Click - css

I have several spans that contain text options. Below it I have an input text input field. What I would like to have happen is when a user clicks on one of these text options, that option will move into the empty text field and the text options will reconfigure to fill it's place.
I could probably do something with CSS3 here but I'm looking for other options.
What I'm looking for is similar to what you'll find on stackoverflow at the bottom of the page when you're asking a question. You select tags from a dropdown list and when clicked on they move into the text field.
Is there an efficient way of doing this that won't rely exclusively on CSS3 and that is also relatively backwards compatible?

Related

Text in flash button symbols all change at once (Actionscript 2)

I have reached an impass which means I have to spend many hours doing something in a very tedious way because I can't work out a way to do it quickly, here is my problem.
In flash if I make a button that consists of a rectangle and a text field then make it all a button symbol, if I then copy the symbol to multiple instances on screen and change the text in one of them, it changes in all of them because I am changing the symbol.
How can I overcome this, perhaps with actionscript? I tried writing.
button1.text1.text = "test change button text"; on the main canvas (and giving one button a name of button one and the text field within it text1) but it doesn't work.
The only thing I found that works was to make multiple symbol copies of the button but then if I want to change the colour or dimensions of all the buttons it takes ages.
Is there a better way? Using actionscript 2 perhaps, or just some property of the button to allow individual text?
I attempted your situation... and I didn't run into your problem. Text boxes are individual values, provided that the text box is dynamic or input
I think that what may solve your problem is checking what kind of text boxes you are working with. Look in the properties panel; does it say "dynamic"?

Auto Complete Extender for multiline textbox - Facebook style

I have in my application a larger textbox and offer user the possibility to enter text on several rows like this:
first piece of text
second piece of text
and so on...
Each row is a distinct piece of data that has a significance. The thing is I would like to use ajax auto complete extender functionality after the user types a certain character on a row, such as #, and filter the records in the database according to the first letter the user typed after #, moment when the auto complete suggestion list would appear. For example, third piece of text #Action1, means that after the user typed A he would be prompted with a list of values to choose from.
There are several items of concern for me: first, it is possible to use autocomplete extender only for part of the text in the textbox, and second does it work like this for multiple rows (i.e. one time - in each line behaviour)? Regarding its position, I guess I have no other choice than at the bottom of the textbox it refers to, despite I would have liked it to appear below the # symbol.
Thank you very much.
Update: I found something similar to what I am looking for here: Twitter-style autocomplete in textarea, but the author only explained briefly his solution. Any help much appreciated, thx!
Each row is a distinct piece of data that has a significance.
Why are you using a textarea then, and not multiple <input> fields?
Sounds to me like your error in UI design lies right there already, so the rest of my answer is rather theoretical; I probably won’t go into more details as the sensible fix for your problem is the one above.
first, it is possible to use autocomplete extender only for part of the text in the textbox,
Why shouldn’t it be? Cursor position in a textarea for example is readable (although it requires some working around cross-browser issues).
and second does it work like this for multiple rows (i.e. one time - in each line behaviour)?
So long as the line breaks are “hard” ones (made by the user themselves, using enter/return), splitting the actual textarea content by "\n" to have each row as a single value is no problem.
Regarding its position, I guess I have no other choice than at the bottom of the textbox it refers to, despite I would have liked it to appear below the # symbol.
You could try to roughly measure the #’s position, by line and col number it is on, and match that to the character width and line height, when using a monospace font. For other fonts, some more “magic” might be required to measure the actual width of the previous text before the # character.
I have created a Meteor package for this, which allows both free text and multiple autocomplete sources. Meteor's data model allows for fast multi-rule searching with custom rendered lists. If you're not using Meteor for your web app, (I believe) you unfortunately won't find anything this awesome for autocompletion.
https://github.com/mizzao/meteor-autocomplete
See the link for pictures of how it works. Fork, pull, and improve!

ASP.NET typing text vs using label

What's the difference between typing some text on a page vs inserting a label and typing some text into that label ?
Any reason why somebody would want to use a label vs just type text on the page ?
The only advantage that I can think of is that a label can be updated easily ( e.g user clicks a button , in the event code for the click action one can write something like label1.Text = "some value" )
Thanks
Labels can be associated with controls using the AssociatedControlID property, allowing the user to click the label to focus the control.
If a label is associated with a checkbox, clicking the label will toggle the checkbox.
You've nailed it. Putting text inside a label control allows you easy programmatic control over that portion of the page, while putting it directly in the HTML requires you to then jump through extra hoops if you want to modify it later.
In addition, you can also programmatically show/hide a label, add css styles, and associate it with an input control (AssociatedControlId property).
You can't easily apply CSS styling to random text on the page.
Edit - Sorry I meant in server side code.
The difference is that typing into a Label causes it to render the HTML from the server side while typing text into the HTML does not.
This is very useful if you want to change the text dynamically or if you need to deal with changing the text for internationalization.
ASP.NET labels should be used to much like HTML labels: to indicate which control this text is related to. ASP.NET also has the LiteralControl, which is just text, and is better suited to your needs.
Typing text directly onto your page is often uncontrollable - It is difficult to control where it will appear, and in what manner. Labels have very predictable features that can be adjusted easily to work with formatting. Furthermore, as your page gets more complicated, having text in labels that is identifiable with IDs makes things significantly easier.

Change behaviour of placeholder attribtute

The Placeholder Element which got introduced with HTML5 is great but sadly I really dislike its implementation, that when I click in a field the suggestion text is gone.
I'd like it to be different in the way that if empty it should show the placeholder text if it is focused or not. Basically always show the placeholder except if text is in the box.
I am using jQuery so any implementation which utalizes it would be okay to.

Inability to store long list of values

I am not able to figure out how to store long list of values (like a big text) in a dropdown list or in intellisense of search box. I see that it is displaying only half of the text but not full. How to make it appear full in the intellisense or dropdown?
Yes, dropdownlist control or the other similar controls are not suitable for displaying long texts. You should increase their with and it's not look pretty. My recommendation is to develope a tooltip client side script that display the full text, this would help you to show much text than the actual one.

Resources