Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Form Submission Question
November 17, 2005, 3:21 pm
rate this thread
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 "email@example.com" 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
"firstname.lastname@example.org", 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
// This will remove the ' @domain.com' part, (leaving just "joe")
before submitting the form.
if ( (USERID contains "@domain.com") )
returnval = USERID -"domain.com";
returnval = USERID;
<FORM NAME="LOGIN" AUTOCOMPLETE="OFF" METHOD="POST"
ACTION="https://form.domain.com " onSubmit="return WackTheDomain()">
User Name <INPUT TYPE="TEXT" id ="USERID" NAME ="USERID"
Password <INPUT TYPE="PASSWORD" id ="PASSWORD" NAME ="PASSWORD"
<INPUT TYPE="SUBMIT" id ="SUBMIT" NAME ="SUBMIT" alt = "Submit The
<INPUT TYPE="HIDDEN" id ="ACTION" NAME ="ACTION" VALUE="LOGIN">
Re: Form Submission Question
What you want here is a regular expression.
Were you the "email@example.com" in a thread here a few days ago, asking
a similar question about "@domain.com", _and_ I gave you an example of a
Here, try this:
- » how to display whatever the user types in a textarea
- — Next thread in » HTML Authoring Forum