madhavi sastry

Greenhorn
+ Follow
since Oct 28, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by madhavi sastry

I'm still not able to print the value in my jsp

I tried <%int value=Integer.parseInt((String)request.getAttribute("noofcards"));%>

It shows NumberFormatException

I tried ${noofcards} also. It is not printing any value

11 years ago
JSP
i have a list of size 3

in my controller i say

int noofcards=list1.size(); which returns me the value 3

i want to print this value in my jsp. How do i do it ?

i tried this way

Controller
request.setAttribute("noofcards",noofcards);

JSP
<%= request.getAttribute("noofcards") %>

Thanks in Advance
11 years ago
JSP
hi
Suppose i have 10 checkboxes and i allow the user to check max of 4 checkboxes.
When the limit is reached i.e. 4, i need to disable all the other checkboxes
and when i uncheck anyone (now only 3 are checked) all the checkboxes should be enabled

Here's the code which i tried
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


<script type="text/javascript">

function checkboxlimit(checkgroup,max,min){
var checkgroup=checkgroup
var onlycheckgroup;


for (var i=0; i<checkgroup.length; i++){

checkgroup[i].onclick=function(){
var checkedcount=0

for (var i=0; i><checkgroup.length; i++){
checkedcount+=(checkgroup[i].checked)? 1 : 0
alert("checkedcount is "+checkedcount)


if (checkedcount==max){
var a=checkgroup[i].checked;
alert("only checked "+a);
if(a==true){
onlycheckgroup=document.getElementsByName('selectedItems');
alert("onlycheckgroup "+onlycheckgroup);


alert("in for loop");

alert(1);
onlycheckgroup[i].disabled=true;


}
else{
alert(2);
onlycheckgroup[i].disabled=false;
}


}
}
}
}

}


></script>


</head>

<body>


<input type="checkbox" name="selectedItems" id="check" onclick="checkboxlimit(selectedItems,2)";/> <c:out value="John"/> <input type="checkbox" name="selectedItems" id="check" onclick="checkboxlimit(selectedItems,2)";/> <c:out value="Smith"/> <input type="checkbox" name="selectedItems" id="check" onclick="checkboxlimit(selectedItems,2)";/> <c:out value="Peter"/> <input type="checkbox" name="selectedItems" id="check" onclick="checkboxlimit(selectedItems,2)";/> <c:out value="Angel"/>




</form>
</body>

</html>


please help