I run a VERY small business, where I'm building an intranet for our employees to use (add clients, generate invoices, things like that) I needed to generate an employee's username based on their first and last name. My original goal was to include verification, to make sure we aren't generating a username that already exists, but that can come later, I've only got 29 employees right now, and my methods won't create conflicts, yet.......
its a very simple javascript function I call genid to take a user's input based on first and last name, and spit out a username and an email address, which are plugged into readonly fields in the same form

Code:
function genid() {
		var a = document.getElementById('fname').value
		var b = document.getElementById('lname').value
		var c = a.substring(0,1);
		var d = (c + b);
		var e = d.toLowerCase();
		var f = '@email.com';
		var g = (e + f);
		document.getElementById('uname').value = (e);
		document.getElementById('email').value = (g);
		}
And then, in my form, once a user fills out the lname field, I call genid via an onblur, and the appropriate username and email fields are filled in. The code works as designed, but after declaring 7 variables, I realize its probably sloppy, and could have been more efficiently carried out. I'm not a web designer, but I like to do things "right" nonetheless, so any pointers on cleanup would be appreciated.