GetDotted Domains

Viewing Thread:
"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 28/01/05 at 19:11
Regular
Posts: 10,364
Argh!

Just finding a simple bit of code off the internet is proving to be so difficult because people over complicate their example scripts with crap functions that do unessacery work.

Basically, all I want is a simple form validation routine which checks to see if all items on the form are filled in...

The ones that I have tried don't seem to work!

The items I have on my form (which is named "details") are as follows

1 textbox named: "title"
1 textarea named: "introduction"
1 textarea named: "the product"
1 textarea named: "item"

Could anyone just give us a simple script that will check to see if all of these fields are filled in?

Cheers
Sat 29/01/05 at 11:18
Regular
"It goes so quickly"
Posts: 4,083
Yeah, as Nimco said below.

I think the open / close element method is a lot better than having a value attribute in this case, due to the amount of text a ) then you shouldn't have a
> problem.

Cheers cjh - I think this is what caused the problem in the first place, I remember tidying up my code and that was probably what made it work.

Oh and nice one for the auto focus code!
Sat 29/01/05 at 09:43
Regular
"It goes so quickly"
Posts: 4,083
You can also include an auto-focus within each check if you like, for example:

if (formnamehere.realname.value == "") {
alert("Required field: Please enter your name...");
document.formnamehere.realname.focus();
return false;
}

You should also watch out for the way you code in a - contains a space.
- contains two line breaks.

As long as you keep your ) then you shouldn't have a problem.
Fri 28/01/05 at 23:33
Regular
"Bicycle"
Posts: 4,899
majek
Fri 28/01/05 at 21:37
Regular
Posts: 10,364
wtf?

It's just randomly started working.

Randomly

Grrr, I hate it when things like this happen.

Case closed, Cheers.
Fri 28/01/05 at 21:34
Regular
Posts: 10,364
Just had a look and it is those pesky "textarea" things which are causing the problem.

Input boxes work fine...!
Fri 28/01/05 at 21:22
Regular
Posts: 10,364
Thanks...

Although, It doesn't seem to work properly.

Say if I don't enter anything within the form and click submit, it'll prompt me to ask for a title. After inputting the title and leaving the rest of the form blank, it just moves onto the next page without validatiing the rest of the form.

Any ideas why?

It might be worth mentioning, the other 3 items are 'textareas'
Fri 28/01/05 at 19:28
Moderator
"Are you sure?"
Posts: 5,000
Put this in the HEAD:


change realname,email,message as required to match the names you've used in the form fields.

Put this on the end of your FORM tag: onsubmit="return validate();

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.
Many thanks!!
Registered my website with Freeola Sites on Tuesday. Now have full and comprehensive Google coverage for my site. Great stuff!!
John Shepherd

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.