This topic is locked

Reset button in advanced search doesn't work

6/1/2011 4:18:06 PM
PHPRunner General questions
J
JCRamos author

The reset button on the advanced search page does not empty the contents of their fields.

I'm using 5.3.7474 PHPRunner and default theme.

To clear the fields I am using the following code for each fieldname in Javascript OnLoad event:

var ctrl = Runner.getControl (pageid, 'fieldname');

ctrl.clear ();



Is there another way to reset the page?
Thanks.

L
Lena 6/3/2011

Hi,

The Reset button sets the fields values to the original ones on the Advanced search page.

In the next version of PHPRunner the Reset button will work correctly.
As workaround you can use the custom button for clear the values of fields with this code:



var ctrl = Runner.getControl (pageid, 'FieldName');

ctrl.clear ();
J
JCRamos author 6/3/2011

Thank you very much.

var ctrl = Runner.getControl (pageid, 'fieldname');

ctrl.clear ();



So I'm doing fine, but not to all the fields:
I can only clean the fixed fields on the left (like "fieldname" in visual editor), which I can apply the above command.
However, I can't clear the fields displayed on the right (like "fieldname_editcontrol1" in visual editor) when the operator "between" is chosen because I do not know his name to apply the "clear()" function.
Does anyone know how to clean these fields?
Thanks again.

J
JCRamos author 6/4/2011

Una solucion que solo limpia los valores de los campos, no los "select" ni los "not" :



// Limpiamos los valores escritos en todos los campos:

// Obtenemos el array de controles de la tabla:

var recCtrlsArr = Runner.controls.ControlManager.getAt('TABLENAME');

// recorremos el array y los limpiamos:

for(var i=0;i<recCtrlsArr.length;i++)

{ var ctrl = recCtrlsArr[i];

ctrl.clear();

}


Keep searching...