# Get Field value from jQuery onLoad

**URL:** <https://community.ofelia.com/t/get-field-value-from-jquery-onload/6240>\
**Category:** Q&A\
**Created:** [4 August 2015 19:50 UTC](https://community.ofelia.com/t/get-field-value-from-jquery-onload/6240 "2015-08-04T19:50:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghermolopez](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@ghermolopez](https://community.ofelia.com/u/ghermolopez)\
**Post date:** [4 August 2015 19:50 UTC](https://community.ofelia.com/t/get-field-value-from-jquery-onload/6240/1 "2015-08-04T19:50:27Z")

</div>

Hi,

I’m trying to create a process in BonitaSoft that on one form load some data from a MySql database using an script on JQuery. I created a HTML Widget with the next code

`

`

It “should” get the form field “dfDispID” value and send it to myUrl.php and set the response into the field dfField2.value (plain text).

But… it doesnt work.

I tried with an alert ($(“#dfDispID”).val()😉 on document load and i get a “undefined”. I cant reach the field from Firefox

Note: My field has set in General \> Options the HTML attribute id=‘dfINFO\_TipoDispositivo’

Any help?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [5 August 2015 09:36 UTC](https://community.ofelia.com/t/get-field-value-from-jquery-onload/6240/2 "2015-08-05T09:36:20Z")

</div>

Hi,

at first there seems to be a couple of issues with your script.

I had some working examples of what you are trying to achieve. Might help.  
[https://jsfiddle.net/jasdompa/1/](https://jsfiddle.net/jasdompa/1/)  
[https://jsfiddle.net/jasdompa/2/](https://jsfiddle.net/jasdompa/2/)

Vincent

---

<div class="post-metadata">

**Author:** ![ghermolopez](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@ghermolopez](https://community.ofelia.com/u/ghermolopez)\
**Post date:** [5 August 2015 12:09 UTC](https://community.ofelia.com/t/get-field-value-from-jquery-onload/6240/3 "2015-08-05T12:09:13Z")

</div>

Sorry, i modified the script a bit cause it some variables was in spanish and i screwed it up a bit.

I find the solution while i was taking some screenshots to give more info of my problem. Inspecting a bit the code i found that my field is inside a iframe id=“bonitaframe” and i cant reach it directly, need to use iframe.contents() to get it.

`
$("#bonitaframe").contents().find("#dfINFO_TipoDispositivo").val()
` worked like a charm

Thanks!!!
