You need to sign in to do that
Don't have an account?
multiple selection checkbox
hi,
I have a requirement where two sections
1. it has a search input filed where the user enters a name and clicks on search which will display a list of users with check boxes and the user is allowed to select the checkboxes what user they want.
2. in this section it should display the users which the user selected using the checkboxes in the top section if a user deselects on the top section it should deselect in the bottom section also.
Can anybody explain me how it can be achieved. I know may be it can achieved using java script but not sure how to start with i may cretae a onclick function which calls the javascript and in the java script i can add all the selected users to below section. but not sure about the code i dont know javascript much.
Find below a sample code for Your functionality. You Can Use This Java Script Code :
<SCRIPT>
<!--
<!-- Begin
function Check(chk)
{
if(document.myform.Check_ctr.checked==true){
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}else{
for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
}
}
// End -->
</script>
Here is the code for body part .
<form action="checkboxes.asp" method="post">
<b>Scripts for Web design and programming</b><br>
<input value="1">ASP<br>
<input value="2">PHP<br>
<input value="3">JavaScript<br>
<input value="4">HTML<br>
<input value="5">MySQL<br>
<input value="yes"
onClick="Check(document.myform.check_list)"><b>Check Control</b>
</form>
but how can i capture the selected records using checkboxes. Thanks for the prior answer. Anyways i will post the code what i have done till now.
Page:
controller
this code now can display the list of users with checkboxes. I should extend it to work for when i select a checkbox here a section below should show up and display the selected record and when i deselct the checkbow on top the record should disappear in the bottom section.
So what i taught is if we can capture the records which we have selected in top section in a list. we can display in the bottom section easily..
Hope i gave enough information. please let me know if you need more information.