![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| 719-572-9400 719-638-3545 hi, I have a group of checkboxes like this Code: <input type="checkbox" name="chk12" id="chk12" value="Yes">Quote 12 <input type="checkbox" name="chk11" id="chk11" value="Yes">Quote 11 <input type="checkbox" name="chk10" id="chk10" value="Yes">Quote 10 <input type="checkbox" name="chk9" id="chk9" value="Yes">Quote 9 <input type="checkbox" name="chk8" id="chk8" value="Yes">Other <input type="textbox" name="chk8othertext" id="chk8othertext" value=""> if the user selects Other checkbox and doesnt enter a value in the other textbox then fire an alert here is my code Code:
if (document.frm1.chk12.checked == false && document.frm1.chk11.checked == false && document.frm1.chk10.checked == false && document.frm1.chk9.checked == false && document.frm1.chk8.checked == false )
{
alert ('You didn\'t choose any of the checkboxes!');
return false;
}
else
{
return true;
}
If(document.frm1.chk8.checked ==true)
{
if(document.frm1.chk8othertext.value =="")
{
alert("enter a value");
}
}
any idea todd |
| Sponsored Links |
|
#2
| ||||
| ||||
| You never get to your second IF statement. Remove the else clause of hte first IF.
__________________ Wolffy ------------------------ Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary. |
| The Following User Says Thank You to Wolffy For This Useful Post: | ||
richyrich (June 19th, 2008) | ||
|
#3
| ||||
| ||||
| what do you mean not working? are you getting an error message?
__________________ Quote of the Month: Quality: The race for quality has no finish line- so technically, it's more like a death march. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright © 2008 sbenj69 |
|
#4
| ||||
| ||||
| Assuming that your code is in some Event Procedure, Wolffy is right. The way you have it, the first If statement either returns True or False, but in either case it returns, which means bye-bye, it's done. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| display problem checkbox | todd2006 | JavaScript Programming | 4 | May 30th, 2008 03:58 PM |
| [ASP.Net/VB.Net] Programmatically Add Item to Validation Summary | jmurrayhead | Code Samples | 0 | March 20th, 2008 09:41 AM |