This topic is locked

JavaScript OnLoad

2/12/2019 11:37:09 AM
PHPRunner General questions
B
bencroftweb author

Hi All
It's been a while but I thought I would post up as I have a new project on my desk.
I want to learn more about how to write in the JavaScript Onload section of PHPRunner.
I wondered if there are any links to good examples as guidance for development. The reason I ask is although I have gotten many things to work perfectly the code never looks anything like what I get from Google results.
I understand the basics but would like to explore more options like copying text from one field to another but removing the spaces and special characters.
I am currently running v9.8 but poised to upgrade to version 10 within the next week.
Many thanks
Ben

admin 2/12/2019

You really need to ask more specific questions. In Javascript OnLoad event you can use any Javascript code.
To copy field from one field to another you need to do getValue() on first field, strip unwanted characters (usually using regular expressions) and do setValue() on second field.
https://xlinesoft.com/phprunner/docs/ctrl_getvalue.htm

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

https://stackoverflow.com/questions/7151159/javascript-regular-expression-remove-spaces