Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet check box in jsp

Have Programming Question? Ask it here!
 
 
 


varadhan raj
check box in jsp
1 Answer(s)      3 years and 3 months ago
Posted in : JSP-Servlet


hey guys

i am working on a web based project using jsp. In my project 1 am having 9 check boxes in 3 rows in the same form. I want to select 1 check box from each row and also i want to avoid many check box selected in the same row. How can i get this one working?

Can anyone help me


Advertisement
View Answers

January 22, 2011 at 5:57 PM


Hi Friend,

Try this:

<script>
function checkBoxValidate1(cb) {
for (j = 0; j < 3; j++) {
if (eval("document.myform.ckbox1[" + j + "].checked") == true) {
document.myform.ckbox1[j].checked = false;
if (j == cb) {
document.myform.ckbox1[j].checked= true;
         }
      }
   }
}

function checkBoxValidate2(cb) {
for (j = 0; j < 3; j++) {
if (eval("document.myform.ckbox2[" + j + "].checked") == true) {
document.myform.ckbox2[j].checked = false;
if (j == cb) {
document.myform.ckbox2[j].checked= true;
         }
      }
   }
}

function checkBoxValidate3(cb) {
for (j = 0; j < 3; j++) {
if (eval("document.myform.ckbox3[" + j + "].checked") == true) {
document.myform.ckbox3[j].checked = false;
if (j == cb) {
document.myform.ckbox3[j].checked= true;
         }
      }
   }
}
</script>
<BODY>

<form name=myform>
<table>
<tr><td>Selection 1<input type="checkbox" name="ckbox1" onClick="javascript:checkBoxValidate1(0)"></td><td>Selection 2<input type="checkbox" name="ckbox1" onClick="javascript:checkBoxValidate1(1)"></td><td>Selection 3<input type="checkbox" name="ckbox1" onClick="javascript:checkBoxValidate1(2)"></td></tr>

<tr><td>Selection 4<input type="checkbox" name="ckbox2" onClick="javascript:checkBoxValidate2(0)"></td><td>Selection 5<input type="checkbox" name="ckbox2" onClick="javascript:checkBoxValidate2(1)"></td><td>Selection 6<input type="checkbox" name="ckbox2" onClick="javascript:checkBoxValidate2(2)"></td></tr>

<tr><td>Selection 7<input type="checkbox" name="ckbox3" onClick="javascript:checkBoxValidate3(0)"></td><td>Selection 8<input type="checkbox" name="ckbox3" onClick="javascript:checkBoxValidate3(1)"></td><td>Selection 9<input type="checkbox" name="ckbox3" onClick="javascript:checkBoxValidate3(2)"></td></tr>


</form>

Thanks



Related Tutorials/Questions & Answers:
check box in jsp
check box in jsp  hey guys i am working on a web based project using jsp. In my project 1 am having 9 check boxes in 3 rows in the same form. I want to select 1 check box from each row and also i want to avoid many check box
HI Jsp check box..!
HI Jsp check box..!  Hi all.. I want to update the multiple values of database table using checkbox..after clicking submit the edited field has to update and rest has to enable to update...please help me..its urgent
Advertisements
how to insert check box
how to insert check box   how to insert check box into jtable row in swing
check box left justification
check box left justification  how to make a check box left justification which is at right end? thanks in advance
click on check box
click on check box  I create a check box in HTML and when i click on my check box relative information in page store in database
Dynamic check box problem
Dynamic check box problem  In my project i have used a dynamic table, in the each row of that table there is one check box [that i have created... check boxes ... pleas help me as soon as possible...   1)application.jsp
check box condition
check box condition  Hai, my application has two check box one for chart and another one for table.when We click chart check box download only chart but table also download.same problem in table slection..xsl coding was used
Check Box Validation in PHP - PHP
Check Box Validation in PHP  How can validations done on check boxes more than 3?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/javascript-array/javascript-array-checkboxes.shtml
check box realtive information in page store in database
check box realtive information in page store in database  check box relative information in page store in database  hiiiiiiiii, Que I create a checkbox in html and when i click on my check box realtive information
Creating Check Box in Java Swing
Creating Check Box in Java Swing       This section illustrates you how to create a Check Box component in Java Swing. In this section, you can learn simply creating the Check Box
combo box - JSP-Servlet
combo box  how to get a combo box in jsp page which allows editing as well as list box
instead of text boxe i have to show check box as selected.
instead of text boxe i have to show check box as selected.  i have one text field. in that iam getting boolean value either true or false from... have to show check box as selected. Thanks In advance R.Raveen.
msg box in jsp
msg box in jsp  i need the source code to display the msgbox in jsp....but one condition is,i need to use it in the current page itself...now i use the message box means it prints it into another page...i need to resolve it plz
List Box - JSP-Servlet
list box.on selecting one value in list box,i will retrieve values from database and store into another list box in same page using javascript :location.my problem is in first list box,value which i selected to get values is not displaying
How to check no records - JSP-Servlet
How to check no records  Hi all, I am developing an onlineshopping project, in that how i have 2 check no records. I saw an answer... to check and display your cart is empty.... PLs help me......... Reply
combo box - JSP-Servlet
combo box  I am using a JSP form in which a combobox is given and I want to populate data in it from database and on the basis of yhe selected item I want to display related data in a textbox  Hi Friend, Create
check username availability using JSP & JQuery
check username availability using JSP & JQuery  Hi sir I want check username availability using JSP & JQuery. Please add code with your answer. Thnks in advance
Checkbox Problem--Please Check this - JSP-Servlet
Checkbox Problem  I am facing a problem while creating a check box in JavaScript. Can any one share the part of code to create a checkbox in JavaScript
Check Box Midlet Example
;, "J2ME", "J2EE", "JSF"). if user select a check box... J2ME CheckBox ChoiceGroup MIDlet       This example illustrates how to create check
how to crate callout box in jsp - JSP-Servlet
how to crate callout box in jsp  how to create a callout box when pointing a link in jsp page like in MS-word document callout box. Please help me I want to use
JSTL - check odd/even number - JSP-Servlet
JSTL - check odd/even number  How do i create a JSTL program to generate random numbers and to check whether they are odd/even and print...: http://www.roseindia.net/jsp/jsp-jstl-c-when-tag.shtml Thanks
jsp list box - Java Beginners
jsp list box  I have two list boxs. the values for the first list box is retrieved from the mysql database. I want to fill the second list box...("http://localhost:8080/examples/jsp/country.jsp?id="+cid+"&&value="+val
i want to select a multiple value of check box by using onclick or onchange event without using from submission
i want to select a multiple value of check box by using onclick or onchange event without using from submission   i have 4 check box name 1)profile... the result is ok but after getting value of first box now i want a result of second box
check
updated"); will the above code check if the user has entered value for empcode
JSP Text Box properties. - JSP-Servlet
JSP Text Box properties.  How do I restrict a text box created in JSP page only for numbers.. example: I have a function something like... any such in JSP. please let me know how to do it..  Hi Friend, Try
drop down box - JSP-Servlet
drop down box  when i enter some letter in the input box,the corresponding words of that particular letter must be displayed below as a list from the data base in the same input box as drop down. Thanks&Regards, VijayaBabu.M
Javascript List Box - JSP-Servlet
itself.my problem is in list box the semester which i selected is not showing in list box as selected.when i select,the page refreshes but i get the result what i expected.i need to show in list box as semester is selected but it doesnt
check where is error - JSP-Interview Questions
check where is error  hi deepak i have made a program in javascript but it is not working properly will u plz tell me where is error in my program javscsript program function palindrome() { var string
Auto Complete Text Box - JSP-Servlet
Auto Complete Text Box  Please help me in Aotocomplete text box code. I m a java programmer. I m working on jsp tech. please give me the code for Autocomplete text box in which the values will generate from database table
display from select box - JSP-Servlet
display from select box  I am doing a jsp project. In this jsp... selection box which is in the same page. The photos are stored...://www.roseindia.net/jsp/file_upload/ http://www.roseindia.net/jsp/file_upload
how to get combo box value - JSP-Servlet
how to get combo box value  i have created 1 servlet & 1 jsp page. in servlet page i have fired query & fetched name & its id & that i have shown in combo box in jsp page: (small part of my code) "> now i want
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  For example, In Employee.jsp form, When i click employee id value in combo box...... i already stored combo box values from database. pl
Auto Complete Text Box - JSP-Servlet
Auto Complete Text Box - JSP-Servlet  Auto Complete Text Box Please help me in Aotocomplete text box code. I m a java programmer. I m working on jsp tech. please give me the code for Autocomplete text box in which the values
Name Display in alert box - JSP-Servlet
the alert box but the value is not in data base alert box is not display... username = request.getParameter(?username?); boolean isExist = check(username... Name is available.?); } } public boolean check(String username) { Connection
dependent drop down box - JSP-Servlet
the solution how to extract data from dependent drop down box with page refresh...; window.location.replace("http://localhost:8080/examples/jsp/dependentDropdown.jsp?id="+cid+"&&value...; window.location.replace("http://localhost:8080/examples/jsp/dependentDropdown.jsp
populating text box using jsp code
populating text box using jsp code  Sir, How to populate related values in a text box after selecting value from drop down list using JSP and mysql.... Please give an example using jsp code only.   dependentDropdown.jsp
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  I am using a single jsp form.. i did not get from another form.. i do not use 2 jsp form.. all.... Note: I am using only this jsp form.. i do not use
Automatically display in text box - JSP-Servlet
Automatically display in text box  Dear Deepak Sir, When i enter some text in text box.That corresponding value in database,the value display in another text box using ajax. Thanks & Regards, VijayaBabu.M
scroll bars to list box - JSP-Servlet
scroll bars to list box  Can I add scroll bars to a list box in struts?  Hi friend, Scroll the list box in struts Two attribute set "multiple" "size". Select Tag Example Select Tag
JSP check email exists or not
JSP check email exists or not In this tutorial, you will learn how to check... accepts the email id from the user and check whether the given email id already...;text/javascript"> function check(value){ xmlHttp=GetXmlHttpObject
jQuery check username availability using JSP
jQuery check username availability using JSP In this section, you will learn to check username availability from database using JSP & jQuery. In the given below example, a username input field is given, when you type username
How to retrieve data using combo box value in jsp? - JSP-Servlet
How to retrieve data using combo box value in jsp?  Hi freind, I already post this question. I need urgent help from u. pl response me... the following link: http://www.roseindia.net/jsp/comboSelect.shtml Hope
loading value into combo box by selecting value from other combo box - JSP-Servlet
loading value into combo box by selecting value from other combo box  ... is that as i select state from state_combo_box,then the next combo box is dynamically... box with constituency corresponding to district..... all three combo box
how to check username & password from database using jsp
how to check username & password from database using jsp  Hello, I have created 1 html page which contain username, password & submit button.... name is amit and password is ddave. so hw could i check whether the username
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  Hi Friends, When i click combobox value in jsp form page, it will diplay...... For Example, in Student.jsp... when i click student id in combo box
jsp login code ... when username , drop down box and password is correct
jsp login code ... when username , drop down box and password is correct  i need a jsp code for login.... when username password and dropdown box... but its showing as wrong..... i dont know how to check the combo box selected value
To Retain the values entered in the text box after submit in jsp page
To Retain the values entered in the text box after submit in jsp page   i am working on a jsp pge which has many text boxes and one dynamic drop... box , data is retreived from the database and displayed in table format. I have
retrive the data from access database to drop down list box in jsp
retrive the data from access database to drop down list box in jsp  hai, im new to jsp now im using the jsp along with access database.in table i load all the data's i need to retrive the data from database to dropdown list box
How to get data from DB in to Text box by using Jsp & Ajax
How to get data from DB in to Text box by using Jsp & Ajax   I want to get the data from database in to text box in a jsp page by using Ajax. If I enter the letter A in the textbox it should show only those values which starts
How to retreive data by using combo box value - JSP-Servlet
How to retreive data by using combo box value  Hello friend , i am using only one form. U are using html form and jsp form. So get...){ cid=Integer.parseInt(request.getParameter("cid")); I am using only a single jsp
Advertisements
 

 

 

DMCA.com