# Pass Data from a form template to form's JavaScript - component

**URL:** <https://discuss.emberjs.com/t/pass-data-from-a-form-template-to-forms-javascript-component/10984>\
**Category:** Uncategorized\
**Created:** [June 21, 2016, 5:36pm UTC](https://discuss.emberjs.com/t/pass-data-from-a-form-template-to-forms-javascript-component/10984 "2016-06-21T17:36:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafal\_P](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@Rafal\_P](https://discuss.emberjs.com/u/Rafal_P)\
**Post date:** [June 21, 2016, 5:36pm UTC](https://discuss.emberjs.com/t/pass-data-from-a-form-template-to-forms-javascript-component/10984/1 "2016-06-21T17:36:09Z")

</div>

Hello , I’m creating a component which is a form, this is an example of my code:  
template of component:  
`<label> Detector type</label>`  
`{{input type="text" class="form-control" value=s_Typ_Detektora}}`   
`<button type="submit" type="button" class="btn btn-success" {{action "doSave"}}>Save</button>`

JavaScript file:  
`actions: {`  
`doSave() {`  
`var typ= this.get('s_Typ_Detektora');`  
`alert(typ)`;  
`}`  
`}`

The alert window is showing “Undefined”

What can i do to save the parameters?  
Greetings, Rafał

Solved:   
There was a problem with my app, I didn’t knew why but when I’ve created a new app, the same code works perfect.
