5
Answers

Select Header Checkbox all checkbox is checked in JavsScript in MVC Archicture?

Jitendra Patel

Jitendra Patel

15y
10k
1
Hi,

When i have click header checkbox then all checkbox are Checked like (Gmail Inbox) but it is in MVC Archicture useing in JavaScript .

I have not use any server control.
Because my application in MVC.

I am new in MVC. I have do this in asp.net with Gridview but not in mvc.

Thanks,
Jitendra patel
Answers (5)
3
Amit Choudhary

Amit Choudhary

NA 27.7k 3m 15y
hi friend,

i have attached project here. and did what you want using HTML table.
 just analyze the table and javascript code.



Please mark the answer if it helps you.
0
Jitendra Patel

Jitendra Patel

NA 149 0 15y
Hi Dear,

Sorry this code is not useful to me.............

actually my requirement is like this.

Please check this link

http://www.aspsnippets.com/Articles/Using-JavaScript-with-ASP.Net-GridView-Control.aspx

in this it is use a Gridview control but
My data is display in Html Table in MVC Archicture.


So any idea please help me.

Thanks,
Jitendra Patel

0
Amit Choudhary

Amit Choudhary

NA 27.7k 3m 15y
hi friend,

See code below

<SCRIPT LANGUAGE="JavaScript">
<!--
// by Nannette Thacker
// http://www.shiningstar.net
// This script checks and unchecks boxes on a form
// Checks and unchecks unlimited number in the group...
// Pass the Checkbox group name...
// call buttons as so:
// <input type=button name="CheckAll" value="Check All"
//onClick="checkAll(document.myform.list)">
// <input type=button name="UnCheckAll" value="Uncheck All"
//onClick="uncheckAll(document.myform.list)">
// -->

<!-- Begin
function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = false ;
}
// End -->
</script>

Here is the HTML:

<form name="myform" action="checkboxes.asp" method="post">
<b>Your Favorite Scripts & Languages</b><br>
<input type="checkbox" name="list" value="1">Java<br>
<input type="checkbox" name="list" value="2">Javascript<br>
<input type="checkbox" name="list" value="3">Active Server Pages<br>
<input type="checkbox" name="list" value="4">HTML<br>
<input type="checkbox" name="list" value="5">SQL<br>

<input type="button" name="CheckAll" value="Check All"
onClick="checkAll(document.myform.list)">
<input type="button" name="UnCheckAll" value="Uncheck All"
onClick="uncheckAll(document.myform.list)">
<br>
</form>

hope it helps you.

Source article http://www.shiningstar.net/articles/articles/javascript/checkboxes.asp
0
Jitendra Patel

Jitendra Patel

NA 149 0 15y
Hi,

When i have click header checkbox then all checkbox are Checked like (Gmail Inbox) but it is in MVC Archicture useing in JavaScript.

I have not used any server control like (Gridview or datalist or repeater).

My data is bind in Table format.

My application in MVC Archicture

Thanks,
Jitendra Patel
0
kiran kumar

kiran kumar

NA 1.6k 242.1k 15y

whats your requirement?
I have do this in asp.net with Gridview but not in mvc.?
can you explain it more clearly