FAQ: Change the color of input column depending on the selected content
## Answer
Use "「Script」".
---
## Overview
Create a record table, enable ClassA, Value A, and B, then create a new "「Script」" and write the following script.
Check "Create new" and "Edit" for the output destination to update.
Below is a sample script that changes the border color of Value A and Value B depending on the selection of ClassA.
##### JavaScript
```
$(document).on('change', '#' + $p.getControl('ClassA')[0].id, function() {
const myClassA = $p.getControl('ClassA').val();
const myCssBlue = {'borderColor': 'blue', 'background': '#f0f8ff'};
const myCssDefault = {'borderColor': '#c0c0c0', 'background': 'white'};
switch(myClassA) {
case 'A':
// Processing for number A
$p.getControl('NumA').css(myCssBlue);
// Processing for number B
$p.getControl('NumB').css(myCssDefault);
break;
case 'B':
// Processing for number B
$p.getControl('NumB').css(myCssBlue);
// Processing for number A
$p.getControl('NumA').css(myCssDefault);
break;
default:
// Processing for number A
$p.getControl('NumA').css(myCssDefault);
// Processing for number B
$p.getControl('NumB').css(myCssDefault);
break;
}
});
```
If you select "A" in category A, the border color of numA will change to blue.

If you select "B" in category A, the border color of numB will change to blue.

If you select anything other than "A" or "B" in category A, the border color of numA and numB will be returned.

## Related Information
<div id="ManualList">
<article class="s-blog_list_unit"><h2>
<h2>The specified information was not found.</h2>
<p><a href="/ja/manual">Return to top</a></p>
</article>
</div><input id="SearchTextHidden" type="hidden" value="" />