un approccio minimale (dò per scontato che tu abbia già provveduto a verificare che i campi siano formalmente corretti)
codice:
<script>
function checkdomain() {
web = document.getElementById('web').value;
email = document.getElementById('email').value;
domain_web = web.match(/@.+$/);
domain_email = email.match(/@.+$/);
return (domain_web == domain_email);
}
</script>
<form action="#" onsubmit="return checkdomain()">
Web: <input type="text" id="web" name="web" />
Email: <input type="text" id="email" name="email" />
<input type="submit" />
</form>
Ciao
-Fab-