-
return false;
}
else
{
return true;
document.cancel_complaints.submit();
}
}
----------
in case of one row(i.e only one record i.e only one checkbox) the value of lenvar is undefined and if there are more than one row the value of lenvar comes= (no of checkboxes)
i am unable to understand why there is problwm in counting in total no of checkboxes.
if somebody has solution then plz tell me.
thanks in advance">I have a cancel_complaints page in ASP in which list of complaints r coming (2 records come at a time means page navigation).In that page some information is coming in table and i have given a checkbox in one Table column according to records in database table rows are generated.That is multiple checkbox are generated with same name.I have put a validation that if user has selecetd none of checkbox alert message comes.Problem is that when there are more than one row validation is going fine but when only one row remains validation does not goes fine.Below i am giving javascript function that i have used for validation.----------function------------function validatefield(){ var j=0; var lenvar=document.cancel_complaints.chksel.length; //alert(eval(lenvar)); for (i = 0; i < lenvar; i++) {if(document.cancel_complaints.chksel[i].checked) { j=j+1; } } if(j==0) { alert("Please select atleast one checkbox"); return false; } else { return true; document.cancel_complaints.submit(); }}----------in case of one row(i.e only one record i.e only one checkbox) the value of lenvar is undefined and if there are more than one row the value of lenvar comes= (no of checkboxes)i am unable to understand why there is problwm in counting in total no of checkboxes.if somebody has solution then plz tell me.thanks in advance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Is there a way I can set the inactivity lease period on a per-session basis?
Typically, a default inactivity lease period for all sessions is set within your JSPengine admin screen or associated properties file. However, if your JSP engine supports the Servlet 2.1 API, you can manage the inactivity lease period on a per-session basis. This is done by invoking the HttpSession.setMaxInactiveInterval() method, right after the session has been created. For example:<%session.setMaxInactiveInterval(300);%>would...
-
How can I declare methods within my JSP page?
You can declare methods for use within your JSP page as declarations. The methods can then be invoked within any other methods you declare, or within JSP scriptlets and expressions.Do note that you do not have direct access to any of the JSP implicit objects like request, response, session and so forth from within JSP methods. However, you should be able to pass any of the implicit JSP variables as...
-
How can I enable session tracking for JSP pages if the browser has disabled cookies?
We know that session tracking uses cookies by default to associate a session identifier with a unique user. If the browser does not support cookies, or if cookies are disabled, you can still enable session tracking using URL rewriting. URL rewriting essentially includes the session ID within the link itself as a name/value pair. However, for this to be effective, you need to append the session ID for...
-
How do I use a scriptlet to initialize a newly instantiated bean?
A jsp:useBean action may optionally have a body. If the body is specified, its contents will be automatically invoked when the specified bean is instantiated. Typically, the body will contain scriptlets or jsp:setProperty tags to initialize the newly instantiated bean, although you are not restricted to using those alone. The following example shows the "today" property of the Foo bean initialized...
-
Is there a way to reference the "this" variable within a JSP page?
Yes, there is. Under JSP 1.0, the page implicit object is equivalent to "this", and returns a reference to the servlet generated by the JSP page.
JSP Interview Questions
Ans