Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-14-2011, 04:27 PM   PM User | #1
Treeze
New to the CF scene

 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Treeze is an unknown quantity at this point
Javascript newbie needs help with html form validation please

Hi

I am trying to write a simple script for html form validation before going on to write a more complicated script for the full form which will eventually be on the web page. However, I cannot tell if the javascript is executing or not, as no alert messages come up. If I fill in the form with blanks (which is what the function checkform() checks for) then it should display an alert on submission and return false. Otherwise, returns true.

I need to get this licked before going on to the more complex coding, but I really can't see why this doesn't appear to work. I'd be most grateful if some kind soul out there could have a look at it for me.... Links below.

Thank you in anticipation!

http://www.kellyresources.co.uk/onli...ment_test.html
http://www.kellyresources.co.uk/checkform.js
Treeze is offline   Reply With Quote
Old 07-14-2011, 05:53 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 362 Times in 361 Posts
sunfighter is on a distinguished road
We need to see all the code. But for starters if statements are inclosed in parentheses and a compassion is done with == not =.
SO:
if document.assessmentform.phone=""

Should be:

if (document.assessmentform.phone == "" )
sunfighter is online now   Reply With Quote
Old 07-14-2011, 05:56 PM   PM User | #3
Treeze
New to the CF scene

 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Treeze is an unknown quantity at this point
thanks for that! I knew that, don't know how I missed that one - I've made the change and am still no clearer as to what is happening, if you'd like me to post up sections of code I'm happy do so..
Treeze is offline   Reply With Quote
Old 07-14-2011, 06:24 PM   PM User | #4
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 362 Times in 361 Posts
sunfighter is on a distinguished road
Your top link is broken. So yes code would be nice.
sunfighter is online now   Reply With Quote
Old 07-14-2011, 06:30 PM   PM User | #5
Treeze
New to the CF scene

 
Join Date: Feb 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Treeze is an unknown quantity at this point
Hi sunfighter. Thanks to your help, and looking at it again I am now getting somewhere, so no worries for now - I will post again when I need help for the next, more complicated bit!
Treeze is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:36 PM.


Advertisement
Log in to turn off these ads.