FW: [PHP] about forms with php

From: Date: Fri, 20 Sep 2002 11:48:21 +0000
Subject: FW: [PHP] about forms with php
Groups: php.general 
Request: Send a blank email to php-general+get-116995@lists.php.net to get a copy of this message
Hi, > <form name="sign" method="POST" action="sign_up_.php" > onSubmit="checkemail(email.value);return false" > > > and when I click submit.. javascript is working but > it is not going to the sign_up_ page ...... It's because of the "return false": that means "after running the checkemail function, cancel the form submission". I think you want to have your function return true or false depending on whether the email address is OK, and take the return out of the onsubmit handler. Don't forget to validate the email address on the server as well, otherwise people who turn off Javascript will be able to submit dodgy data. Cheers Jon

« previous php.general (#116995) next »