JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old May 28th, 2004, 05:04 PM
jen2004 jen2004 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 jen2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile newbie help? please

sorry if i sound dumb, but these two functions work ok on their own but as soon as i put them together they dont. Not too clued up on passing variables.

Also the second part of the function is to ensure that one of 4 radio's are checked, but only if a checkbox is checked, however, the alert pops up even if the checkbox isnt checked?!

Any help much obliged!


function valid(contactform) {
var field = contactform.tel;
var telno = parseInt(field.value);
var selection = -1;
if (!telno) {
alert("Please enter a valid number");
field.focus();
field.select();
return false}
else {
alert("ok");
return true;
}


for(i=0;i<contactform.choice.length;i++){
if(contactform.choice[i].checked){
selection =i
alert("Thankyou, a brochure for " +contactForm.choice[i].value+ " is on its way")
}
}
if(selection == -1){
alert("please select a brochure")
return false
}


return true
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > newbie help? please


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway