Hello,
I´m looking for a “getFormFields” method in Servoy 4.1.x.
Can someone help with it?
Thank You
Thomas
Hello,
I´m looking for a “getFormFields” method in Servoy 4.1.x.
Can someone help with it?
Thank You
Thomas
What do you expect this to return?
fieldnames or elementnames?
Elementnames is: forms.yourform.elements.allnames
Only restriction is: you need to have all your elements named.
Hi Marc,
I´m expecting all fieldnames on a form
without have the elements named
Thomas
no existing function, but I think this will do the job: (didn’t test it, but I think it should work)
function getFormFields()
{
var $form = arguments[0]; //input formname as argument
var $jsForm = solutionModel.getForm($form);
var $result = new Array();
if(!$jsForm) return $result;
var $jsFields = $jsForm.getFields();
var $jsLabels = $jsForm.getLabels();
var $jsElements = $jsFields.concat($jsLabels);
for (var i = 0; i < $jsElements.length; i++)
{
if($jsElements[i].dataProviderID) $result[$result.length] = $jsElements[i].dataProviderID;
}
return $result;
}
Thank you Marc!
Very nice!
Is working perfectly!
Thomas