How to Change Font Color of a textbox in Jscript

T

tvanhammond

I have been attempting to change the font color of a text box on an
InfoPath form but I need to do this in jscript. Is this possible?
 
B

Ben Walters

Yes this is possible I had to do the same thing for a client who wanted to
track what fields had been chaged.
This is a little limited though,
Add an attribute to the field that you want to change the colour of
then for the text box of the field set a conditional formatting rule that
will check the new attribute you added and based on the value in the
attribute change the font colour.

As I said this a limited approach, but may be a good starting point for you

Cheers
Ben Walters
 
E

eComTim

Thanks Ben. Just to be clear..when you say to 'Add an attribute', what
do you mean? I've added a separate textbox which I can alter the
contents of but I'm not sure what type of Attribute you intended.

Thanks again

Tim
 
B

Ben Walters

Hey Tim,
When adding fields to the xml structure of the form you have an option to
select one of the following

- Field
- Group
- Group (Choice)
- Field (Attribute)
- Complete XML Schema or Document

the reason I suggested adding an attibute is that you could create an xml
structure as follows

<root>
<UserName ColourAtrtibute=""></UserName>
</root>

this way if you need to reuse the same attribute name for a number of fields
you can rather than requireing unique names for something that is essentially
a property of a field.

Hope this helps

Cheers
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top