Re: [PHP] about forms with php

2002-09-21 Thread Chris Hewitt

Meltem Demirkus wrote:

>?Because  when I tried to use them like this:
>
>onSubmit="checkemail(email.value);return false" >
>
>and when I click submit.. javascript is working but it is not going to the
>sign_up_ page ..How can I manage it?..
>
Or simply leave off the "return false" and in your JS routine do
"document.forms[0].submit()"

HTH
Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] about forms with php

2002-09-20 Thread Ford, Mike [LSS]

> -Original Message-
> From: Meltem Demirkus [mailto:[EMAIL PROTECTED]]
> Sent: 20 September 2002 13:03
> 
> by the way If I remove  return false .. script is checking 
> the correctness
> but just after it is going to the page  "sign_up_ page .php 
> "..I just want
> it to go to the page when the email is correct ..
> Is it possible to manage ?

Two options:

(1) Leave your onSubmit as is, and put a form.submit in the checkemail
function once you've "validated" the address.

(2) Change the onSubmit to onSubmit="return checkemail(email.value)" and
have checkemail return true or return false according as it does or doesn't
"validate" the email.value passed.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] about forms with php

2002-09-20 Thread Jon Haworth

Hi,

> by the way If I remove  return false .. script is 
> checking the correctness but just after it is going 
> to the page  "sign_up_ page .php "..I just want
> it to go to the page when the email is correct ..
> Is it possible to manage ?

Yes. You need to have the "return true" or "return false" in the javascript
function that checks the email.

function checkEmail(email)
{
  // do the check however you like
  // create a variable called "check" 
  // that's either true or false,
  // then do something like:
  if (check) {
return true;
  } else {
return false; 
  }
}

HTH

Cheers
Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] about forms with php

2002-09-20 Thread Meltem Demirkus

by the way If I remove  return false .. script is checking the correctness
but just after it is going to the page  "sign_up_ page .php "..I just want
it to go to the page when the email is correct ..
Is it possible to manage ?

meltem
- Original Message -
From: "Jon Haworth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 20, 2002 2:48 PM
Subject: FW: [PHP] about forms with php


> Hi,
>
> >  > 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] about forms with php

2002-09-20 Thread Meltem Demirkus

but I also want to check @ and . characters.. ...checking only if the email
field is  empty or not  is not what I want 
meltem
- Original Message -
From: "Ferhat Can" <[EMAIL PROTECTED]>
To: "Meltem Demirkus" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, September 20, 2002 2:49 PM
Subject: Re: [PHP] about forms with php


>   Hi Meltem,
>Since you place return false in the onSubmit code, you cannot submit
the
> form to the next page. What you need to do is that check if the email
field
> is empty, if yes return false; if not return true.
>
>
> - Original Message -
> From: "Meltem Demirkus" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, September 20, 2002 2:44 PM
> Subject: [PHP] about forms with php
>
>
> > Hi,
> >
> > I want to learn if anyone tried to use both of javasccript and php
> together
> > ?Because  when I tried to use them like this:
> >
> >  > onSubmit="checkemail(email.value);return false" >
> >
> > and when I click submit.. javascript is working but it is not going to
the
> > sign_up_ page ..How can I manage it?..
> >
> > thanks alot..
> > by the way , by using javascript , I am checking  if the email adress
are
> > written correctly ( '@' ...)..
> >
> > thanks
> >
> >
> > meltem
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] about forms with php

2002-09-20 Thread Ferhat Can

  Hi Meltem,
   Since you place return false in the onSubmit code, you cannot submit the
form to the next page. What you need to do is that check if the email field
is empty, if yes return false; if not return true.


- Original Message -
From: "Meltem Demirkus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 20, 2002 2:44 PM
Subject: [PHP] about forms with php


> Hi,
>
> I want to learn if anyone tried to use both of javasccript and php
together
> ?Because  when I tried to use them like this:
>
>  onSubmit="checkemail(email.value);return false" >
>
> and when I click submit.. javascript is working but it is not going to the
> sign_up_ page ..How can I manage it?..
>
> thanks alot..
> by the way , by using javascript , I am checking  if the email adress are
> written correctly ( '@' ...)..
>
> thanks
>
>
> meltem
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php