Remove Colon From the Label

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
skellie
Posts: 36
Joined: Thu Nov 28, 2013 3:00 am
Location: Waterloo, Canada

Remove Colon From the Label

Post by skellie »

Hi
How do I edit the label style? Don't like the colon appended to the label and cant figure how to remove it.
Thanks
skellie
Posts: 36
Joined: Thu Nov 28, 2013 3:00 am
Location: Waterloo, Canada

Edit the Form Label

Post by skellie »

No responses?
OK, will elaborate. Say I want to create a long label, one of those rambling life insurance questions that goes on for lines, eg Have you ever been diagnosed with, or had symptoms of, heart disease, for instance: angina, myocardial infarction, murmur, shortness of breath, et al... ?

This label works best above the yes/no combobox and the question ends with a question mark. Then there's that pesky colon that just doesn't fit. A small thing maybe but I want to zap it.

So I guess the real question is where can I get some control over the label's positioning and it's style?
hpl123
Posts: 2605
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Html

Post by hpl123 »

Instead of using the yes/no label, you can use a html cell for the question. You would then have full controll over the "label" (i.e html).
Henrik (V8 Developer Ed. - Windows)
skellie
Posts: 36
Joined: Thu Nov 28, 2013 3:00 am
Location: Waterloo, Canada

Post by skellie »

OK, I see it on p158 of the user guide. Thanks for this.
Does seem like quite a bit of work though to set labels ... suppose can use an html editor and then just copy the code.
hpl123
Posts: 2605
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Post by hpl123 »

If you just need the labels and no formating etc you write the text directly in the html cell and you're done.
Henrik (V8 Developer Ed. - Windows)
skellie
Posts: 36
Joined: Thu Nov 28, 2013 3:00 am
Location: Waterloo, Canada

Post by skellie »

Have done this but solution not really ideal. The label needs to be 'attached' to the combo box because the combo box's visible property is conditional. Depending on the answer to a previous question the combo box might not be visible. And if it is not visible then its label must also not be visible. Achieve this via the READ PROTECT rule. Not sure how to to do this with the HTML solution. Suppose I could try define the HTML cell as an attribute, then attach the 'hide' rule to it. But seems it it would be easier if I could edit the label formatting.
rocketman
Posts: 1252
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Post by rocketman »

Try putting the html cell and the yes/no attribute cell inside Separator start and end lines.

You could then put a "Condition When Visible" on the separator start line
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
skellie
Posts: 36
Joined: Thu Nov 28, 2013 3:00 am
Location: Waterloo, Canada

Post by skellie »

I see what you're saying, thanks Rocketman.
Challenge is that I don't need separators there.

Think for now I will use labels and leave out question marks. They're old school anyway, one can see from the sentence structure that it is a question.

But still feel that more control over labels would be a good thing. Not all labels are two-word wonders. Some can go on for quite a few lines. It would be nice if AwareIM gave us more control over this, eg RTF and don't make punctuation assumptions. And if anyone knows where the code is for that colon I would really appreciate it... thanks.
skellie
Posts: 36
Joined: Thu Nov 28, 2013 3:00 am
Location: Waterloo, Canada

Post by skellie »

Actually I see you can enhance labels with bold, italics etc.
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Post by Rennur »

To remove the colon from labels:

1. Open C:\AwareIM\Tomcat\webapps\AwareIM\aware_ext\aware.js
2. Find and remove {labelSeparator} (inc. brackets, there should be 2 instances)
3. Find ALL labelSeparator and remove : found at the end ":" (eg..labelSeparator:(config.label==null||config.label.length==0?"":":"),

Cheers
rocketman
Posts: 1252
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Post by rocketman »

Shame. If it wasn't for the fact that the only choices available are Pop Up, right side or bottom, you could use the attribute description to achieve wht you want. If you could live with the text underneath the attribute it would look quite smart.
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
skellie
Posts: 36
Joined: Thu Nov 28, 2013 3:00 am
Location: Waterloo, Canada

Post by skellie »

It's done, many thanks Rennur.

At first could not get it right - aware.js is a mass of code does not seem properly formatted in my editor, and kept crashing the editor. So opened aware_full.js and did deletions in that file. Did not work. Then went back to aware.js and did the job. Lovely. Hope I havn't messed anything by changing aware_full.js. Anyway made notes as I went so should be able to recreate if I need to.

Thanks to all for trying to help, appreciate it.
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

Re: Remove Colon From the Label

Post by UnionSystems »

I have an alternative way to remove colons from the end of field labels. Keen to hear any wise critique of this :

Add the following javascript to the Form or Form tab Render script

Code: Select all

/* Removes all colons from field labels */
var labelArray=document.getElementsByTagName("label");
for(var i = 0; i < labelArray.length; i++){
    labelArray[i].innerHTML=labelArray[i].innerHTML.replace(':','');
    }
 
AWS Linux, Windows Server, AIM 8.4 & 8.6
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Remove Colon From the Label

Post by PointsWell »

UnionSystems wrote:I have an alternative way to remove colons from the end of field labels. Keen to hear any wise critique of this :

Add the following javascript to the Form or Form tab Render script

Code: Select all

/* Removes all colons from field labels */
var labelArray=document.getElementsByTagName("label");
for(var i = 0; i < labelArray.length; i++){
    labelArray[i].innerHTML=labelArray[i].innerHTML.replace(':','');
    }
 
Thanks - will give this a go. I have a number of fields on a BO that are conditionally mandatory but its really hard to put the * in the right place to manually show the required status.
Post Reply