You are here: Form Submission Question « HTML « IT news, forums, messages
Form Submission Question

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>&nbsp;</p>
Password <INPUT TYPE="PASSWORD" id ="PASSWORD" NAME ="PASSWORD"
VALUE="">
<p>&nbsp;</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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация