# Vision Formatted Text Field border style scripting

**URL:** <https://forum.inductiveautomation.com/t/vision-formatted-text-field-border-style-scripting/42269>\
**Category:** Ignition\
**Created:** [January 14, 2021, 9:35pm UTC](https://forum.inductiveautomation.com/t/vision-formatted-text-field-border-style-scripting/42269 "2021-01-14T21:35:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathaniel.Jarrett](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@Nathaniel.Jarrett](https://forum.inductiveautomation.com/u/Nathaniel.Jarrett)\
**Post date:** [January 14, 2021, 9:35pm UTC](https://forum.inductiveautomation.com/t/vision-formatted-text-field-border-style-scripting/42269/1 "2021-01-14T21:35:35Z")

</div>

Trying to set up some scripting on the Formatted Text Field to change the border style from red to black when the Text meet the Regex pattern or the committed text.

Under Scripting and Parameter Change I’ve tried the bottom two methods utilizing an custom boolean property ‘validity’ that is linked to the styles desired. The bottom similar method was used in a normal Text field and was working but the Formatted Text Field is not updating the custom property value when the match condition is met.

1. Matching commit text to field text  
import re  
if event.propertyName == ‘text’:  
pattern = event.source.validationPattern  
text = event.source.text  
commit = event.source.committedValue  
match = re.match(commit, text)

2. Matching regex pattern to field text  
import re  
if event.propertyName == ‘text’:  
pattern = event.source.validationPattern  
text = event.source.text  
commit = event.source.committedValue  
match = re.match(pattern, text)

Thanks for the help
