cancel
Showing results for 
Search instead for 
Did you mean: 

Color in Text Field

Former Member
0 Kudos

Hi Guru,

I have the requirement to Highlight filed when the field is Read-Only field.

I try to put the code as below for both javascript and FormCalc.

FormCalc

this.fillColor = "224,224,224"

this.border.fill.color.value = "224,224,224"

JavaScript

xfa.form.data.Page1.IT0014.WageType.Amount.fillColor = "224,224,224"

It is nearly work except the Label is also hightlight. What should I add in the code to highlight just only tex field not for both label and text field.

Thanks in advance for your help.

Regards,

Visut

Accepted Solutions (0)

Answers (5)

Answers (5)

OttoGold
Active Contributor
0 Kudos

I am not sure but I think there is a simple workaround for this. You can implement some event on a object and in some other event script you can call the first objects event - that means you implement event to change color with JS on some dummy object and from you code you call this "exec event" (I don´t remember exactly) from your FC code.

BTW: if you do not work with webservices and some other minor features then JS is stronger and can do everything what FC can. Maybe you should consider a scripting language switch:))

Otto

p.s.: I am sorry but I cannot write this in FormCalc, I am not strong at scripting at all:)))

OttoGold
Active Contributor
0 Kudos

Of course you can but 1) why do you care? You can use both in one form and in a single object/ field. 2) you will not be able to use "this" pointer 3) if that is so crucious, adapt the code for yourself:))

Otto

Former Member
0 Kudos

Hi Otto,

The reason that I ask for Form Calc because some coding that I am currently use is Form Calc. And I need to add this script in between. If Form Calc is not working for this, I need to revise my script and use Java Script instead.

I already try to put the code that Pradeep mention in FormCalc but it does not work. It is working fine with JavaScript. Please let me know what should I put for FormCalc.

Thanks in advance,

Regards,

Visut

Former Member
0 Kudos

Hi Vistul,

I am not that well versed with FormCalc as I use JavaScript. i don't know exactly whether "$.ui" is present in FormCalc, try some ways and there is a way. And as Otto said you can switch to JS as it is a bit stronger, but strictly speaking on performance it is not best to use any scripts in Adobe Forms as recommened by SAP.

Regards

Pradeep Goli

Former Member
0 Kudos

Hi Pradeep,

Thanks a lot for your feedback. I try to avoid script as well but sometimes I believe that there is no way to avoid like the color. User always want something at that time.

Just one simple question, how can I use below FormCalc code in JavaScript?

$record.CONTROL_PARAM.ISR_MODE

Actually this is the way to call the data without place in the form. But I am not sure how can I call record directly like above in JavaScript.

Thanks a lot for your help,

Regards,

Visut

chintan_virani
Active Contributor
0 Kudos

You can try following code, may be it should work.

xfa.record.CONTROL_PARAM.ISR_MODE

Chintan

Former Member
0 Kudos

Thanks a lot Chintan.

Regards,

Visut

Former Member
0 Kudos

Hi Visut,

You can use this script


//JavaScript
//if listbox - use choiceList, textfild-use textEdit
this.ui.textEdit.border.fill.color.value = "224,224,224";

There are many changes to be done if there are many fields

Read the Scripting

http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_ba...

http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf

Regards

Pradeep Goli

Former Member
0 Kudos

Hi Pradeep,

That's help a lot. Just one more curious, can I use FormCalc instead of Javascript?

Thanks a lot!!,

Regards,

Visut

Former Member
0 Kudos

An easy solution may be to have remove the label(caption) for your Read Only field and use a separate Text field instead. That way, your color should only affect the field you want

OttoGold
Active Contributor
0 Kudos

Hello,

you cannot do that at design time? Read-only attribute changes a lot? If you´re in a hurry and not able to find the "right" solution, you can always place mutlitple fields with the same value, colour them at design time and change the presence of these fields.

I will try to look for a scripting solution. Or... maybe you can change the design time attributes of the fields which will change the behavior when scripting... Try "appearance" on tab Object.

Otto