Changing part of text to a different color in an input - text

Am a newbee to javascript but have plenty of experience in VB, C, and even 86 assembler. Maybe I am trying to do the impossible in porting a VB app to js here. Basically, I need to change the color for only part of the string in an input element. Here is the problem:
A function takes an entered input box text field, and processes it first to see if it is in conformity to a set of requirements. If part of that string is not in conformity, I would like to in some way highlight that part in the input field. For instance, maybe I can send back the string to the input element (eg using the value attribute) but with some highlighting for that part, such as changing its text color or background color. Is this possible in js?

I'm not sure whether you can change colors of partial text in a simple text box. But what you're trying to do is certainly possible with this: https://editorjs.io/
The example on the homepage shows you how.
I hope this is a possibility for you and not too heavy for your purpose.

Related

How do i fill Text with objects?

newbie here. I want to code a website by myself with html, css and javascript. Is there any way I can use the outline of a text as a "barrier" and fill the inside of the letters with objects?
Objects like those on this website: https://www.fullbundle.com/
I want those objects to be interactive to the cursor, so they only become visible if you hover over the text. Like a rippling hover effect but with objects inside.
I already tried to find an answer by myself by inspecting similar websites but I couldn't find a solution
In the next step, I want to make a scrolling effect. When the filled text gets in touch with the top of my display it bursts and the objects inside are flying all over the place.
I know it's very much for a beginner but I am curious about how it's done.

Extendscript dropdownlist item color

Does anyone know if you can change the color of the text for specific items in a dropdown list in Adobe's extendscript ScriptUI? I know about the color section of the Script UI guide, however that says nothing about list items and I tried a few things by chance but wasn't able to find a solution.
The ScriptUI is converted to HTML5/CSS behind the scenes. Because the CSS is not exposed to the user, it is not possible to change any of the colour schemes.
You can use images for buttons to add colour to them, but that wouldn't apply to dropdowns.
I'm not certain about the other Adobe programs, but I know that creating an extension (as opposed to a script) for After Effects is a way of circumventing this restriction.

RichEdit, How to set the background color of one single line

I have a TRichEdit control containing source code. I want to set the background color of a single line.
I know how to set the text color, but isn't there a way to set the background color as well? I'm not talking about the entire background colour for the whole control, only how to change one single line.
Do I really have to write a custom control to do this?
There is no TRichEdit property for setting the background color of individual characters/lines. However, you can use the Win32 API SendMessage() function, or the TRichEdit's own Perform() method, to send it an EM_SETCHARFORMAT message, specifying a CHARFORMAT2 structure whose crBackColor field is set to the desired color. You can apply formatting to existing characters by highlighting them first, or you can apply formatting to the current caret position if there is no selection.
The MSDN on RTF specifies \cbN, where N is the color index.
Other searches suggest this is not supported by a lot of applications (OS X's native RTF viewer, Microsoft Word) so maybe you should look for a custom solution.

Highlighting an item in the actionbar when in a certain activity when using ActionBarSherlock

I'm putting the final touches on an application that Ive been working on for quite a while and while I understand how to restyle existing components by using inheritance Im coming up blank in my search on how to accomplish this last thing.
I want to apply a custom color/image behind the text or icon representing the current activity I am in. This would be similar to how the tabs have the highlight underneath them while selected. I am already using the tabs and have figured out how to change the image resource that is the little underline in the tab bar. Now I just need to accomplish the same look for the action items.
Ive overlooked the actionbarsherlock library for the past day and a half but I dont see anywhere that I could do what I want to accomplish. I have to imagine that such a thing can be done but like I said before so far Im coming up short. Any help would be much appreciated.
I figured out a simple way to do what I asked earlier. I just created a square shape in xml, put text over it, assigned it the gradient and color I wanted and assigned it to that action item I wanted highlighted in the activity i was in.

Browser Ctrl+F find non-visible text

Can the browser feature of Ctrl+F to find text be integrated with text in popup windows.
I'd like to have some scientific reference information given when someone hovers over a species name in a web page. Generating the popup, tooltip style text is no problem, the problem is that anyone using Ctrl+F won't be able to find it, or if I position the text out of view when not required, it will be found but be invisible.
The same sort of effect applies to "accordion" style expanding text areas.
I'm looking for some sort of event generated when find is highlighting a result.
Unfortunately there is no such event, you can't interfere with the built-in find.
About the best you can do in this case is to provide your own search function in-page, which searches the DOM for Text nodes containing the given text, highlights them, and opens up any closed accordions they're in.
The only idea I have, is to put all the text from your popups in one additional scrollbox (maybe at the bottom of the page) with a height just large enough to display one set of detail information at a time. This way, it doesn't take up too much space on the page, and the text can still be found using Ctrl+F.

Resources