This topic is locked
[SOLVED]

 Update fields using java

7/6/2011 6:42:47 AM
PHPRunner General questions
A
Athlon author

Hello all, I am sure this is a simple task for a java person. I can do this with php but can not use it because i need it to update first but allow changes if need be on the same form. I'm guessing Java would be a better solution.
I have Address1, Address2,Address3,Postcode,Town on the main form. These are filled by the user.
I also have UAddress1,UAddress2,UAddress3,UPostcode,UTown which I want java to auto update after the user enters the info above (with the same data). Usually it is the same but it has to allow them to edit/change it if need be. Therefore I guess the java needs only to run after the postcode is entered and not again. I would appreciate it if someone could provide some guidance. I do not know java and have tried to play with examples for several hours to no avail. I think I have the variables set correctly but can not make the actual function work to write the data.
var ctrlAddress1 = Runner.getControl(pageid, 'Address1');

var ctrlAddress2 = Runner.getControl(pageid, 'Address2');

var ctrlAddress3 = Runner.getControl(pageid, 'Address3');

var ctrlPostcode = Runner.getControl(pageid, 'Postcode');

var ctrlTown = Runner.getControl(pageid, 'Town');

var ctrlUAddress1 = Runner.getControl(pageid, 'UAddress1');

var ctrlUAddress2 = Runner.getControl(pageid, 'UAddress2');

var ctrlUAddress3 = Runner.getControl(pageid, 'UAddress3');

var ctrlUPostcode = Runner.getControl(pageid, 'UPostcode');

var ctrlUTown = Runner.getControl(pageid, 'UTown');
Many Thanks.
Mike.

  • I understand a new PHP 6 is to be released soon. Will this work with all older versions / projects if purchased

C
cgphp 7/8/2011

It's not java...it's javascript! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=59323&image=1&table=forumreplies' class='bbc_emoticon' alt=':lol:' />

function copy_value(target,origin)

{

target.setValue(origin);

}
ctrlAddress1.on('keyup',function(e){

copy_value(ctrlUAddress1,this.getValue());

});
ctrlAddress2.on('keyup',function(e){

copy_value(ctrlUAddress2,this.getValue());

});
ctrlAddress3.on('keyup',function(e){

copy_value(ctrlUAddress3,this.getValue());

});


and so on...