Hi,
It’s been at least 3 years since I have had to even think about using JavaScript, but something came up in work today that meant I had to start remembering it quick.
I need a part of a script to take a user name (first name and surname), then produce an ‘alert’ that will confirm the details to the user and tell them their username.
So far I have this:
[code]
name = prompt( “Enter your first name:”, “Firstname” );
surname = prompt ( “Enter your surname:”, “Surname” );
var names = new Array(name , surname);
var fname = “First Name: ” + name + “n”;
var sname = “Surname: ” + surname + “n”;
var uname = “Username: ” + names.join(“.”);
//var uname = “Username is: ” ;
alert( “” + fname + sname + uname );
(It may not be the best way to set about doing it but I am a network security guy so JavaScript is not something I usually need to use.)
This used to be done by email but my users complained it takes to long to reach them with their user name (apparently either less than a minute is not good enough or they can’t be arsed to open outlook)
There is another script that goes off and does what it needs to do with the username.
I’m just wondering if it is possible to do it from the one prompt() box instead of using two?
It is part of a bigger picture, that uses a very antiquated system; the username format changes very regularly which is why I want to inform the user there and then what their username will be – my guys are getting too many complaints.
Thanks for any help.