|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 } |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > newbie help? please |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|