I have the following script which simply takes whatever is in the "Email" field, and puts it in the "Username" field. Can anyone think of a reg expression that would only take the characters up to the @ symbol in an email address, and place only those characters in the "Username" field?
Thanks so much
Rick
<script type="text/javascript" >
function data_copy()
{
document.getElementById("username").value=document.getElementById("email").value;
}
</script>
<form name="form1">
<p>Email Address:
<input name="email" type="text" id="email" onmouseout="data_copy();"/>
<p>Username:
<input name="username" type="text" id="username" disabled="disabled"/>
</form>
Thanks so much
Rick
<script type="text/javascript" >
function data_copy()
{
document.getElementById("username").value=document.getElementById("email").value;
}
</script>
<form name="form1">
<p>Email Address:
<input name="email" type="text" id="email" onmouseout="data_copy();"/>
<p>Username:
<input name="username" type="text" id="username" disabled="disabled"/>
</form>