Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Can you condense my 4 lines of code into 1 line?

$
0
0

I'm writing a passive validation script that validates fields with the Enter & Exit events and changes the background colour and border colour of just the field's value:

 

this.ui.oneOfChild.border.fill.color.value = "255,216,229";

this.ui.oneOfChild.border.getElement("edge", 0).color.value = "244,138,159";

this.ui.oneOfChild.border.getElement("edge", 1).color.value = "244,138,159";

this.ui.oneOfChild.border.getElement("edge", 2).color.value = "244,138,159";

this.ui.oneOfChild.border.getElement("edge", 3).color.value = "244,138,159";

 

This is working fine my question is how can I condense these four lines into one line of code?

 

this.ui.oneOfChild.border.getElement("edge", 0).color.value = "244,138,159";

this.ui.oneOfChild.border.getElement("edge", 1).color.value = "244,138,159";

this.ui.oneOfChild.border.getElement("edge", 2).color.value = "244,138,159";

this.ui.oneOfChild.border.getElement("edge", 3).color.value = "244,138,159"; 

 

I'm using this on every single field, and it's starting to make my code swell.

 

Thanks!


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>