JavaScript Radio Button Validation help.?
-
Hello All. Need help adding a “continue anyway” button on my JavaScript Pop up. Pretty much you have several radio buttons to choose if you check all the radio buttons and click submit, it goes to the next page. If not a Java pop up will say please check all radio buttons before hitting submit. Everything works fine except the continue anyway button. When the javascript validation pop up I want an ok button and a continue anyway. Does anyone know to add the continue anyway button.. Below is my Java Script of everything but….. function isChecked(radgrp) { var i = radgrp.length; do if (radgrp[--i].checked) return true; while (i); return false; } function validateTest(els) { var focus_me = null, msg = ""; if (!isChecked(els.game1)) { msg += " Game #1\n"; focus_me = focus_me || els.game1[0]; } if (!isChecked(els.game2)) { msg += " Game #2\n"; focus_me = focus_me || els.game2[0]; } if (!isChecked(els.game3)) { msg += " Game #3\n"; focus_me = focus_me || els.game3[0]; } if (!isChecked(els.game4)) { msg += " Game #4\n"; focus_me = focus_me || els.game4[0]; } if (!isChecked(els.game5)) { msg += " Game #5\n"; focus_me = focus_me || els.game5[0]; } if (!isChecked(els.game6)) { msg += " Game #6\n"; focus_me = focus_me || els.game6[0]; } if (!isChecked(els.game7)) { msg += " Game #7\n"; focus_me = focus_me || els.game7[0]; } if (!isChecked(els.game8)) { msg += " Game #8\n"; focus_me = focus_me || els.game8[0]; } if (!isChecked(els.game9)) { msg += " Game #9\n"; focus_me = focus_me || els.game9[0]; } if (!isChecked(els.game10)) { msg += " Game #10\n"; focus_me = focus_me || els.game10[0]; } if (!isChecked(els.game11)) { msg += " Game #11\n"; focus_me = focus_me || els.game11[0]; } if (!isChecked(els.game12)) { msg += " Game #12\n"; focus_me = focus_me || els.game12[0]; } if (!isChecked(els.game13)) { msg += " Game #13\n"; focus_me = focus_me || els.game13[0]; } if (!isChecked(els.game14)) { msg += " Game #14\n"; focus_me = focus_me || els.game14[0]; } if (!isChecked(els.game15)) { msg += " Game #15\n"; focus_me = focus_me || els.game15[0]; } if (!isChecked(els.game16)) { msg += " Game #16\n"; focus_me = focus_me || els.game16[0]; } if (msg != "") { var prefix = "\nThe following Games(s) were not selected:\n\n"; var suffix = "\nPlease correct and re-submit your picks."; alert(prefix + msg + suffix); if (focus_me) focus_me.focus(); return false; } return true; }
-
Answer:
Use 'confirm' instead of 'alert'. See example at link below for more details.
skateman... at Yahoo! Answers Visit the source
Related Q & A:
- How to change color of radio button when checked radio button?Best solution by Stack Overflow
- Can you help me find Oprah radio station mailing address?Best solution by oprah.com
- Need some radio installation help?Best solution by Yahoo! Answers
- Can anyone help with a code for a ford fiesta radio?Best solution by Yahoo! Answers
- Need help debugging a javascript?Best solution by allwebdevhelp.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.