GetDotted Domains

Viewing Thread:
"Some Javascript Help"

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.

Fri 02/05/03 at 20:27
Regular
Posts: 787
Hi.

Right, basically I'm trying to write a swear checker function. The code is this:





















The swear checker itself seems to work - it chucks up an alert if any of the words are found - but what it doesn't do is stop the form from doing it's action. So even if the alert comes up, the 'return false;' part of it never seems to get through and I really don't know why.
As well as that in the alert, if there's more than one word, there's always a comma before every word after the first and I cannot ascertain as to why.

Any ideas?

Cheers.
Sat 03/05/03 at 11:13
Regular
"tinycurve.gif"
Posts: 5,857
Here's one thing I noticed which I thought was pretty obvious, but it may not be the only problem with the script:

Change:


to:
Sat 03/05/03 at 02:31
Regular
"bing bang bong"
Posts: 3,040
First of all, I know absolutely SFA javascript

Regarding your first problem, I would hazard a guess it's to do with the value being returned. If the line:



Were hard coded:



..does that definetly do what you want it to do (presumably stop the form from submitting)? If it does, I would look at the actual value being returned your swear_checker() function - try outputting it in a popup box or something.


Regarding your second problem, I would guess it's just what you get when you output an array - you get each value printed, with a comma in between. If you want more control, make a loop to cycle through all the elements in the array, which will give you as much control as you want over how it's written to screen.
Fri 02/05/03 at 20:27
Regular
"You've upset me"
Posts: 21,152
Hi.

Right, basically I'm trying to write a swear checker function. The code is this:





















The swear checker itself seems to work - it chucks up an alert if any of the words are found - but what it doesn't do is stop the form from doing it's action. So even if the alert comes up, the 'return false;' part of it never seems to get through and I really don't know why.
As well as that in the alert, if there's more than one word, there's always a comma before every word after the first and I cannot ascertain as to why.

Any ideas?

Cheers.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Great services and friendly support
I have been a subscriber to your service for more than 9 yrs. I have got at least 12 other people to sign up to Freeola. This is due to the great services offered and the responsive friendly support.
Very pleased
Very pleased with the help given by your staff. They explained technical details in an easy way and were patient when providing information to a non expert like me.

View More Reviews

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

Go to Support Centre

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.