This topic is locked
[SOLVED]

 Join FirstName LastName and domain name to create email

4/13/2011 6:30:17 AM
ASPRunnerPro General questions
G
gdmacdo author

On the registration page, I would like to construct the email address (Email field) from:
data("FirstName") & "." & data("LastName") & "@domainname.org"
The user would type their First Name in the field FirstName, fill in their Last Name in the LastName field, and when leaving that field they would see their email address already composed before submitting the registration page. Is this possible? Perhaps something in the Javascript OnLoad Event? Any help would be appreciated.

J
Jane 4/14/2011

Hi,
you can use JavaScript onload event on the Eventstab to generated this value on the fly.

Here is a sample:

var ctrlFirstName = Runner.getControl(pageid, 'FirstName');

var ctrlLastName = Runner.getControl(pageid, 'LastName');

var ctrlEmail = Runner.getControl(pageid, 'Email');



function func() {

str = ctrlFirstName.getValue()+'.'+ctrlLastName.getValue()+'@domainname.org';

ctrlEmail.setValue(str);

};



ctrlFirstName.on('change', func);

ctrlLastName.on('change', func);



More info:

http://xlinesoft.com/asprunnerpro/docs/javascript_api.htm

G
gdmacdo author 4/14/2011

Thank you very much. Works perfectly!



Hi,
you can use JavaScript onload event on the Eventstab to generated this value on the fly.

Here is a sample:

var ctrlFirstName = Runner.getControl(pageid, 'FirstName');

var ctrlLastName = Runner.getControl(pageid, 'LastName');

var ctrlEmail = Runner.getControl(pageid, 'Email');
function func() {

str = ctrlFirstName.getValue()+'.'+ctrlLastName.getValue()+'@domainname.org';

ctrlEmail.setValue(str);

};
ctrlFirstName.on('change', func);

ctrlLastName.on('change', func);



More info:

http://xlinesoft.com/asprunnerpro/docs/javascript_api.htm

J
jade30 4/18/2011

Perhaps something in the Javascript onload Event jade? Any help would be appreciated.