Click here to Skip to main content
16,016,750 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i am new in development field..i have problem regarding validation..this is my webpage diagram here..
VB
NoOfAnswers:12345671234567***here i have a dropdownlist of seven answers...every answer is associated with textbox and checkbox...here above textbox has been written as 1 t0 7...previous one just as no of answrs in DRP frm 1 to7..pls i want to put validation on checkbox..so that we could skip to click on  only one answer..so pls help me out..if i click on 3 answers frm DRP thn we will not be allowed to skip it..at least on answer must be checked..pls help me out..

[CbxAnswer1]
[CbxAnswer2]
[CbxAnswer3]
[CbxAnswer4]
[CbxAnswer5]
[CbxAnswer6]
[CbxAnswer7]
thanks .....
Posted

You will find some idea in my recent solution how to save the selected checkbox text into database[^].

—SA
 
Share this answer
 
I didn't get your question clearly, but you want validation on drop down list right.. just go through this..


HTML
<select id="selctionlist" name="Answer to:">
   <option>1</option>
   <option>2</option>
   <option>3</option>
   <option>4</option>
   </select>
   <input type="text" /><input type="checkbox" name="c" /><br />
    <input type="text" /><input type="checkbox" name="c" /><br />
     <input type="text" /><input type="checkbox" name="c" /><br />
      <input type="text" /><input type="checkbox" name="c" /><br />
      <input type="button" onclick="validate()" /></select>

JavaScript
function validate()
        {

            var i = selctionlist.selectedIndex;
            if (c[i].checked == false)
            alert("Please check box" +(i+1));
            
            
       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900