# genericForm not behaving

**URL:** <https://community.asterisk.org/t/genericform-not-behaving/43140>\
**Category:** Digium Phone API\
**Created:** [June 20, 2013, 12:33pm UTC](https://community.asterisk.org/t/genericform-not-behaving/43140 "2013-06-20T12:33:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![intellectit](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@intellectit](https://community.asterisk.org/u/intellectit)\
**Post date:** [June 20, 2013, 12:33pm UTC](https://community.asterisk.org/t/genericform-not-behaving/43140/1 "2013-06-20T12:33:13Z")

</div>

Hi,

I have written a fairly simple form. I have two fields using numeric input types. However it doesn’t display the way I would like it to. I can’t move the cursor into either of the fields. Which means I can’t enter anything. Also all of eh soft keys with the exception of the “back”, soft key are blank. What am I doing wrong. Any suggestions would be greatly appreciated.

[code]var app = require(‘app’);  
app.init();

var genericForm = require(‘genericForm’);  
//The array of input items to use in the form  
var form\_items = [  
{  
‘text’ : ‘Extension number’,  
‘setting’ : ‘extension’,  
‘inputType’ : ‘numeric’, //  
‘validate’ : ‘[0-9]+[0-9]+[0-9]’,  
‘errorMsg’ : ‘Must be 3 digits in length’,  
‘inputParams’ : {}  
},  
{  
‘text’ : ‘Password’,  
‘setting’ : ‘password’,  
‘inputType’ : ‘numeric’, //  
‘validate’ : ‘[0-9]+’, //require at least one letter followed by at least one digit  
’errorMsg’ : ‘Must contain digits’,  
‘inputParams’ : {}  
}  
];

genericForm.show({  
‘id’ : ‘exampleForm’,  
‘labelWidth’ : (digium.phoneModel === ‘D70’) ? 140 : 125,  
‘values’ : {  
‘extension’ : ‘123’,  
‘password’ : ‘’  
},  
‘inputs’ : form\_items,  
‘object’ : this,  
‘title’ : ‘Extension Login’,  
‘onkeyline1’ : digium.background,  
‘onkeycancel’ : digium.background,  
‘forceRedraw’ : true  
});  
[/code]

---

<div class="post-metadata">

**Author:** ![sruffell](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/sruffell/32/49_2.png) [@sruffell](https://community.asterisk.org/u/sruffell)\
**Post date:** [June 20, 2013, 6:32pm UTC](https://community.asterisk.org/t/genericform-not-behaving/43140/2 "2013-06-20T18:32:11Z")

</div>

Hi intellectit,

I ran your example and noticed what you reported and then also noticed that the behavior returned to what I would have expected after calling show in the context of the digium.app.foreground event. That said, I do not know why changing the context of the call to genericForm.show() changed the behavior. But at least hopefully you aren’t blocked anymore.

I created a basic [genericFormExample](https://github.com/digium/digium-phone-apps/blob/master/genericFormExample/startup.js) at [github.com/digium/digium-phone-apps](http://github.com/digium/digium-phone-apps) which I hope will help.

Cheers,  
Shaun

---

<div class="post-metadata">

**Author:** ![intellectit](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@intellectit](https://community.asterisk.org/u/intellectit)\
**Post date:** [June 21, 2013, 1:18am UTC](https://community.asterisk.org/t/genericform-not-behaving/43140/3 "2013-06-21T01:18:21Z")

</div>

You are a champ Shaun. That works perfectly.
