GetDotted Domains

Viewing Thread:
"E-Mail Validation Script"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Wed 28/08/02 at 09:32
Regular
Posts: 787
I got my first form submitting this week but I still need to get an E-mail Vlidation script working. Here's the one I'm currently using:



Obviously I don't need to say the form should be called form1 ect. But it doesn't work at all. Can anybody spot what's wrong with it?
Thanks in advance
Rickoss
Thu 29/08/02 at 18:59
Regular
"It goes so quickly"
Posts: 4,083
... and what that does is go through each check, and if it is valid, will move onto the next check, and when it comes to the end tell the Form to Submit (the 'return true' bit). If one of the fields is invalid, the 'return false' bit means the JavaScript is stopped and the Form is told NOT to Submit.
Thu 29/08/02 at 18:57
Regular
"It goes so quickly"
Posts: 4,083
In the
Tag, try putting onSubmit="return send_if_valid();" and then after each error check, put 'return false' then at the end of the script put 'return true'.

E.G.

For the HTML:


... HTML here


For the JavaScript:

Thu 29/08/02 at 09:41
Regular
Posts: 10,437
I've got a new PHP E-mail Validation script, it's simple but it doesn't seem to work. Instead of coming up with an alert, when the page loads it prints the alert text. Can anyone see what's wrong?

if (!eregi ("^([a-z0-9]|\\-|\\.) (space) +@(([a-z0-9]|\\-)+\\.)+[a-z]{2,4}$", $txt2))
die("E-Mail Address Incorrect");
?>

Cheers :-)
Wed 28/08/02 at 11:14
Regular
Posts: 10,437
Anyone know if you can use the name="" attribute in , , and
tags? Because that be what's wrong with the script.

Also, are []'s only used in objects?
Wed 28/08/02 at 11:01
Regular
Posts: 10,437
I'll try taking the [1] and [0] out of the adr, doesn't seem to do anything.
Wed 28/08/02 at 10:56
Regular
Posts: 10,437
D'oh, doesn't work, I'll probably have to use a different script, although I can't see what's wrong with it.
Wed 28/08/02 at 10:50
Regular
Posts: 10,437
Ok, cheers Nimco. The n's actually had \'s before them but they disappeared when I posted it :\

I've got send_if_valid() in onclick on the submit button. I'll try replacing fail() with alert() and get rid of the last function, hopefully it'll work!
Wed 28/08/02 at 10:38
Posts: 0
RiCkOsS wrote:
> function fail(msg){
> alert("Error: " + msg);
> }

Sorry, my mistake, I didn't see this function so you can ignore the bit about replacing 'fail()' with 'alert()' though to be fair, this is a fairly pointless function - it may be worth removing it....
Wed 28/08/02 at 10:36
Posts: 0
I'm no expert with JavaScript, but I've never heard of a function called 'fail()' before. Try replacing it with 'alert()'.

Also, in the error messages you have a single 'n'. I believe you are trying to start a new line - if so, this should be '\n' I think.

How are you calling the JavaScript? In your form, what command are you using to run the JavaScript.

Also, try using the debugging feature in Mozilla - if you don't have it, download it!
Wed 28/08/02 at 09:32
Regular
Posts: 10,437
I got my first form submitting this week but I still need to get an E-mail Vlidation script working. Here's the one I'm currently using:



Obviously I don't need to say the form should be called form1 ect. But it doesn't work at all. Can anybody spot what's wrong with it?
Thanks in advance
Rickoss

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Impressive control panel
I have to say that I'm impressed with the features available having logged on... Loads of info - excellent.
Phil
Everybody thinks I am an IT genius...
Nothing but admiration. I have been complimented on the church site that I manage through you and everybody thinks I am an IT genius. Your support is unquestionably outstanding.
Brian

View More Reviews

Need some help? Give us a call on 01376 55 60 60

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.