Would like to know how to check all checkbox in a website by using ASP?
also how to execute an ASP script when you click a checkbox or by using onclick?
Thank you very much...
1) Do you want the user to click a button to check all of the checkboxes? If so, do you want it done client-side (fast way) or server-side (slow way)?
2) What action (script) needs to happen when the checkboxes are checked?
3) Do you want the action (script) to execute when the user checks a checkbox (bad way, because they could check more than one) or when the user clicks a button, after checking the checkboxes (best way)?
Was this answer helpful ?
Yes No
Just like in a an email, when you click the uppermost checkbox it will check all the checkbox.
i've done in javascript
function CheckAll() {
for (var i=0; i<document.sform.elements.length; i++) {
var e = document.sform.elements[i];
if (e.name != 'allbox') e.checked = document.sform.allbox.checked;
}
}
but i want to convert it into an ASP.
<input type=checkbox onclick=procedure>
<%
sub procedure
.........
end sub
%>
is this script possible?
Was this answer helpful ?
Yes No
It's possible, but it requires the form to be posted back to the server.
Using javascript is the better way to do it, since it doesn't require a round trip from the client to the server, then back to the client.
Was this answer helpful ?
Yes No
ASP/VBScript Client Side Method.
6 lines of code. E-Mail me for the answer.
Was this answer helpful ?
Yes No
How thoroughly helpful of you. The idea of a forum is for people to share knowledge/information.
I serioulsy doubt that you have a cross browser/platform compatible script that can achieve the required results. Do feel free to post back and prove me wrong

Was this answer helpful ?
Yes No