Jump to content

Input field background color


Xiongyi Gao

Recommended Posts

Hi There,

Thanks for your question! This isn't possible using the style editor in Spotfire, but luckily you can use JavaScript...

Edit the HTML and add a new JS script. Here's what I came up with - note you'll need to change the control's ID to match that of the Spotfire control in your text area:

 

x = document.getElementsByTagName('INPUT');

for (i = 0; i < x.length; i++) {

if (x.id == 'b6a6d3b851b54317ab3b99de4d7dfdd4') {

x.style.backgroundColor = "yellow";

}

}Hope that helps!

Andrew (TIBCO Data Science)

Link to comment
Share on other sites

  • 1 year later...

That's great, Andrew! Thanks!

By the way, I had to change a Inputfield (multiple lines)the only change I've made was from "INPUT" to "textarea".

x = document.getElementsByTagName('textarea');

for (i = 0; i < x.length; i++) {

if (x.id == '1371bbee2c1e4d7287a5574fe63f3618') {

x.style.backgroundColor = "yellow";

}

}

Link to comment
Share on other sites

  • 1 year later...

Colleagues,

Could you please advise which tagName could be implemented for DropDown property.

instead "INPUT"

x = document.getElementsByTagName('INPUT');

Also whit i in this script means

x = document.getElementsByTagName('INPUT'); for (i = 0; i < x.length; i++) { if (x.id == 'b6a6d3b851b54317ab3b99de4d7dfdd4') { x.style.backgroundColor = "yellow"; } }

thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...