This topic is locked

Button to copy one field to another field

2/5/2021 10:58:56 AM
PHPRunner General questions
D
DMORT author

I am having difficulty making what seems should be simple function correctly. I am hoping to create a button (or check box) a user can select to copy the input of select fields to another set of fields.

for example: if shipping address is same billing address can select button and the data is filled from the billing address into the shipping address.
In another application I have used the following javascript:
//Pass in an array of controls.

{dialog.object}.setValueFrom(['Address_D','City_D','State_D','Zip_D','County_D'],['Address_1','City_1','State_1','Zip_1','County_1']);

//set value of PlaceD Type

{dialog.Object}.setValue('Place_D_Type','Residence');

//set value of D Place Name

{dialog.Object}.setValue('D_Place_Name','D_Residence');
Unfortunately I was unable to manipulate to work in phprunner. Any guidance in the right direction would be appreciated. I have searched the forum and was not able to locate any information directly.
Thank you

Sergey Kornilov admin 2/5/2021

I'm not familiar with the syntax of that other application but in PHPRunner you can use getValue() to read the value of the Edit control and setValue() to set the value of another control.
https://xlinesoft.com/phprunner/docs/ctrl_getvalue.htm

https://xlinesoft.com/phprunner/docs/ctrl_setvalue.htm