Update a form field value using text with conditions