# Problem changing text field via script

**URL:** <https://forum.inductiveautomation.com/t/problem-changing-text-field-via-script/11881>\
**Category:** Ignition\
**Created:** [June 30, 2016, 4:58am UTC](https://forum.inductiveautomation.com/t/problem-changing-text-field-via-script/11881 "2016-06-30T04:58:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsteward](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jsteward](https://forum.inductiveautomation.com/u/jsteward)\
**Post date:** [June 30, 2016, 4:58am UTC](https://forum.inductiveautomation.com/t/problem-changing-text-field-via-script/11881/1 "2016-06-30T04:58:43Z")

</div>

I’m sure I’m missing something very obvious, but I’m having a problem setting the .text property of a Text Field after a double click. I would like the current date / time to be entered into a Text field when the user double clicks in the field.

Here is my code which doesn’t work.  
Under the MouseClicked event:

`if event.clickCount == 2:
		today = system.date.now()
		timestamp= system.date.format(today,event.source.Format)
		event.source.text = timestamp`

the event.source.text will not update. I noticed if I hit the Enter key while I’m double clicking then the change is made. I guess I need to be able to programmatically send the enter key, but I’m haven’t figured out how to do that. Any help would be greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![Chris\_Taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chris_taylor/32/3315_2.png) [@Chris\_Taylor](https://forum.inductiveautomation.com/u/Chris_Taylor)\
**Post date:** [June 30, 2016, 8:20am UTC](https://forum.inductiveautomation.com/t/problem-changing-text-field-via-script/11881/2 "2016-06-30T08:20:55Z")

</div>

jsteward

in the text field property editor unclick “Reject Updates During Edit”  
it should work fine.

---

<div class="post-metadata">

**Author:** ![jsteward](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jsteward](https://forum.inductiveautomation.com/u/jsteward)\
**Post date:** [June 30, 2016, 1:40pm UTC](https://forum.inductiveautomation.com/t/problem-changing-text-field-via-script/11881/3 "2016-06-30T13:40:20Z")

</div>

Thanks! I knew it had to be something I was missing. 🙂  
Appreciate the quick reply!
