Vad gör denna kod?
<script language="javascript" type="text/javascript">
<!-- hide begin
function ValidateInput(frm) {
var msg = "";
if (!frm.CallerName.value) {
msg += ' - enter your login name\n';
} else {
var chkRegExp = /[^A-Za-z0-9&_]/;
var isValid = !chkRegExp.test(frm.CallerName.value);
if (!isValid) {
msg += ' - provide valid LOGIN NAME, e.g. lastnameab\n';
}
}
if (!frm.CallerDept.value) msg += ' - enter your department\n';
if (frm.CallerDept.value == 'dummy') msg += ' - select your department\n';
if (!frm.CallerExt.value) {
msg += ' - enter your extension\n';
} else {
var chkRegExp = /[^x0-9 -]/;
var isValid = !chkRegExp.test(frm.CallerExt.value);
if (!isValid) {
msg += ' - provide valid extension, e.g. 7676 or x7430\n';
}
}
if (!frm.ProblemDesc.value) msg += ' - enter request description\n';
// E-mail address
var em = frm.CallerEMail.value;
// ... empty is allowed - no notifications
if (em != "") {
// ... has to end with @domain.com
if (em.indexOf('@domain.com') == -1) {
msg += ' - enter your e-mail address\n';
}
}
if (msg.length > 0) {
alert('Please correct the following:\n\n' + msg);
return false;
} else {
return true;
}
}
/*
function EMailFix(frm) {
var sEMail=frm.CallerEMail.value;
if ((sEMail.indexOf('@') == -1) && (sEMail != ""))
{
frm.CallerEMail.value = frm.CallerEMail.value + "@domain.com";
}
}
*/
function SetFocus() {
document.main_form.CallerEMail.focus();
}
// hide end -->
</script>
...och hur skriver jag ut värdet på det som står innan @domain.com?