J
Jeremy
Hi All. I'm hoping I can receive some help from some kind soul. I was
flamed for asking this question elsewhere. In the example below, I have
removed references to the actual domain I'm working on, but this
doesn't change the concept.
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 "(e-mail address removed)" or just "joe." the trick is
making the form accept either of them.
If the value is just "joe" don't do anything to it, and just pass it to
the server and if the value is
"(e-mail address removed)", 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' part, (leaving just "joe")
before submitting the form.
//
function WackTheDomain()
{
if ( (USERID contains "@domain.com") )
USERID = USERID -"domain.com";
else
USERID = USERID;
}
// -->
</SCRIPT>
<FORM NAME="LOGIN" AUTOCOMPLETE="OFF" METHOD="POST"
ACTION="https://form.domain.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>
flamed for asking this question elsewhere. In the example below, I have
removed references to the actual domain I'm working on, but this
doesn't change the concept.
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 "(e-mail address removed)" or just "joe." the trick is
making the form accept either of them.
If the value is just "joe" don't do anything to it, and just pass it to
the server and if the value is
"(e-mail address removed)", 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' part, (leaving just "joe")
before submitting the form.
//
function WackTheDomain()
{
if ( (USERID contains "@domain.com") )
USERID = USERID -"domain.com";
else
USERID = USERID;
}
// -->
</SCRIPT>
<FORM NAME="LOGIN" AUTOCOMPLETE="OFF" METHOD="POST"
ACTION="https://form.domain.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>