PDA

View Full Version : Getting Value from a form



ma_nepali_keta
9 Aug 2010, 11:27 AM
Hi all

I wanted to show a form in a window masking everthing while window is open(The window will contain a form). I managed to do so, but i was wondering how to get
the values from form.In other words i want to have a form where user can enter some values and depending on the "ok" "cancel" button
the values should be passed back to the method from where the windows is opened.

Here is the scenario
User Click a button,a window would be open with ok and cancel button and the depending on the click of button, entered value should
be passed back to the handler..


Any help would be greatly appreciated...
Thank you

arthurakay
9 Aug 2010, 12:24 PM
You have the right idea... you just need to grab the form values in your button handler - and there's any number of ways to do this.

A simple example:


...
buttons: [{
text: 'Save...',
handler: function() {
//grab the values
var value1 = formField1.getValue();

//do something with the values
someCallbackFunction(value1);
}
}]
...

ma_nepali_keta
9 Aug 2010, 1:31 PM
Stupid Me. I forgot about passing values to function.

Your example
someCallbackFunction(value1); solved all my problems.

Thank you arthurakay for your time.

Thank you very much