# Textinput help

**URL:** <https://forum.kirupa.com/t/textinput-help/301766>\
**Category:** Uncategorized\
**Created:** [December 15, 2009, 9:48am UTC](https://forum.kirupa.com/t/textinput-help/301766 "2009-12-15T09:48:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayusuits](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@ayusuits](https://forum.kirupa.com/u/ayusuits)\
**Post date:** [December 15, 2009, 9:48am UTC](https://forum.kirupa.com/t/textinput-help/301766/1 "2009-12-15T09:48:04Z")

</div>

Hi! Im new here. I have 2 textboxes. T1 and T2.

If I type a number in T1, it will automatically add +10 and flash in T2

Ex. 2 - 12

```php
listenForEnterObject = new Object();
listenForEnterObject.onKeyUp=function(){
		voca_pg2.text=parseInt(voca_pg1.text)+10
    }

Key.addListener(listenForEnterObject);

```

My question is, what to do if I want to type in textbox2 and nothing will happen in T

Ex. if I type 4 to textbox1, textbox2 will become 14 right.

I want to edit 14 and change it to 5 so it would look like:

4 - 5

I’ve tried

```php
voca_pg2.onSetFocus = function(oldFocus) {
Key.removeListener(listenForEnterObject);
}

```

but I need to use listenForEnterObject again later again so removing it is not a good idea.

Plus I have a back and next button

```php
button1.onPress = function() { 
	voca_pg1.text=parseInt(voca_pg1.text)-10
	voca_pg2.text=parseInt(voca_pg2.text)-10
};

button2.onPress = function() { 
	voca_pg1.text=parseInt(voca_pg1.text)+10
	voca_pg2.text=parseInt(voca_pg2.text)+10
};

```

it looks like 10 - 20  
20 - 30

How do I make it block so it would not pass negative numbers when they click back button a lot?

Help and suggestions are greatly appreciated. Thank you.
