|
Posted by Jeremy on 11/17/05 17:02
Hi All,
I'm trying to create a client-side event that will run when the user
submits a form. I want them to be able to enter a value for USERID
that will either be "joe@domain.com" or just "joe."
If the value is just "joe" don't do anything to it, and if the value is
"joe@domain.com", strip the "@domain.com" before submitting it.
Here's something that I thought might work, but didn't. Any guru that
could whip something up would be really appreciated. Thanks in
advance!
<SCRIPT TYPE="text/javascript">
<!--
// This will remove the '@domain.com' before submitting the form.
//
function WackTheDomain()
{
if ( (USERID contains "@domain.com") )
returnval = USERID -"domain.com";
else
returnval = USERID;
}
// -->
</SCRIPT>
<FORM NAME="LOGIN" AUTOCOMPLETE="OFF" METHOD="POST"
ACTION="https://someURL.com" onSubmit="return WackTheDomain()">
User Name <INPUT TYPE="TEXT" id ="USERID" NAME ="USERID"
VALUE=""><p> </p>
Password <INPUT TYPE="PASSWORD" id ="PASSWORD" NAME ="PASSWORD"
VALUE="">
<p> </p>
<p>
<INPUT TYPE="SUBMIT" id ="SUBMIT" NAME ="SUBMIT" alt = "Submit The
Form" >
<INPUT TYPE="HIDDEN" id ="ACTION" NAME ="ACTION" VALUE="LOGIN">
</p>
</FORM>
Navigation:
[Reply to this message]
|