Help needed with my validation

This is a discussion on "Help needed with my validation" within the JavaScript Forum section. This forum, and the thread "Help needed with my validation are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 9th, 2007, 10:23
New Member
Join Date: Jul 2007
Location: London
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Help needed with my validation

Hi there, i'm trying to addapt a validation script to incorporate radio button validation, but even when i've highlighted the radio button, the validation is still kicking in and saying that the button needs clicking...

here's my script:
Code: Select all
<script type="text/javascript">
function QuoteFields() {
missinginfo = "";
if (document.frmCRMLead.q1.value == null) {
missinginfo += "\n - Question 1 Required";
}
if (document.frmCRMLead.q2.value == null) {
missinginfo += "\n - Question 2 Required";
}
if (document.frmCRMLead.q3.value == null) {
missinginfo += "\n - Question 3 Required";
}
if (document.frmCRMLead.q4.value == null) {
missinginfo += "\n - Question 4 Required";
}
if (document.frmCRMLead.q5.value == null) {
missinginfo += "\n - Question 5 Required";
}
if (document.frmCRMLead.q6.value == null) {
missinginfo += "\n - Question 6 Required";
}
if (document.frmCRMLead.q7.value == null) {
missinginfo += "\n - Question 7 Required";
}
if (missinginfo != "") {
missinginfo ="You need to add the following:\n" +
missinginfo + "\n" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
</script>

Last edited by karinne; Jul 9th, 2007 at 12:12. Reason: Please use [code]...[/code] tags when displaying code!
Reply With Quote

  #2 (permalink)  
Old Jul 13th, 2007, 23:23
Reputable Member
Join Date: Dec 2005
Location: U.S.A.
Posts: 147
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to ScottR Send a message via Skype™ to ScottR
Re: Help needed with my validation

I'm not sure where the radio button code is in your JS. But I do see a syntax error. It may help.
Code: Select all
if (missinginfo != "") {
missinginfo ="You need to add the following:\n" +
missinginfo + "\n" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
Missing { } in the else statement. Should read...
Code: Select all
if (missinginfo != "") {
missinginfo ="You need to add the following:\n" +
missinginfo + "\n" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else {
return true;
}
}
Reply With Quote
Reply

Tags
radio button, validation

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with validation snappy Web Page Design 4 Mar 27th, 2008 18:33
Designers needed, cloners needed. TargeTemplate Job Opportunities 0 Dec 27th, 2007 03:41
Form Validation Help needed please chimp Web Page Design 4 Dec 2nd, 2006 22:38
Validation help Powderhound Web Page Design 13 Nov 4th, 2006 20:53
Validation JamieH Web Page Design 3 Apr 15th, 2006 01:45


All times are GMT. The time now is 10:47.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43