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



Home Answers Viewqa JavaScriptQuestions checkbox selection in jsp
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


varadhan raj
checkbox selection in jsp
2 Answer(s)      3 years and 11 months ago
Posted in : JavaScript Questions


hey guys

i am working on a web based project using jsp. In my project i am having 9 check boxes in 3 rows in the same form. I want to select i check box from each row and also i want to avoid many check box 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,

<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>
</table>

</form>

Thanks



January 26, 2012 at 11:01 PM


The above solution works for html but not in jsp? Any changes to be made for jsp?



Related Tutorials/Questions & Answers:
checkbox selection in jsp
checkbox selection in jsp  hey guys i am working on a web based project using jsp. In my project i am having 9 check boxes in 3 rows in the same form. I want to select i check box from each row and also i want to avoid many
java swing-action on checkbox selection
java swing-action on checkbox selection  I am working in netbeans...(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JCheckBox checkBox = new JCheckBox(des... = frame.getContentPane(); contentPane.add(checkBox, BorderLayout.NORTH); frame.setSize(300
Advertisements
Selection based on other selection in jsp
selection on same jsp page such that when someone select a category only the products...Selection based on other selection in jsp  I am trying to create a jsp page. Where I am having a select list containing category name and for each
JSP Checkbox
JSP Checkbox In this tutorial you will learn how to create a checkbox using JSP. As we know, checkbox allows multiple selection at a time, but radio... selection always go for checkbox. Using the example we will try to understand how
JSP CheckBox
JSP CheckBox          JSP CheckBox is used to create a CheckBox in JSP... illustrate an elaborate example from 'JSP CheckBox'. To understand and grasp
Selection With Ajax and JSP
Selection With Ajax and JSP  I am working at a jsp page using ajax for country , state, city selection. so if he select country it will populate the state and city selection (both). After selecting country if he select city
how to get the checkbox value in jsp
how to get the checkbox value in jsp  how to get the checkbox value in jsp?   JSP CheckBox Example - how to get the checkbox value in jsp
checkbox with dropdown listbox in jsp
checkbox with dropdown listbox in jsp  i loaded the the data into the drop down listbox in jsp from access database.now i have to add a check box,if it checked means dropdownlist box carryout the data's,else it should
checkbox
checkbox  how to insert multiple values in database by using checkbox in jsp
Learn about JSP CheckBox
Learn JSP CheckBox The tutorial highlight the features by whihc you will be able to know what is JSP checkbox and also how it works in creating a checkbox in JSP. Further, you can know in details about the multiple chechbox values
Modifying a single row of database based on selection in jsp
Modifying a single row of database based on selection in jsp  Hi guys...://www.roseindia.net/answers/viewqa/JSP-Servlet/18899-data-grid-with-edit-and-delete-options-at-each-row-.html http://www.roseindia.net/answers/viewqa/JSP
Drop-down text selection in jsp/html
Drop-down text selection in jsp/html  Hi, I am trying to create JSP page where I have two drop-downs. There are two-sets of data - First set Categories- Movies, Books, Music and the Second set Genres- Action,Comedy,Romantic
deleting messages using checkbox in JSP
deleting messages using checkbox in JSP  Am working on a Mail Server Project. In that I have Inbox And Outbox Messages. Now Each and Every message...;input type="checkbox" name="inboxchk" value="<%=rs.getInt("omailid")%>"><
deleting messages using checkbox in JSP
deleting messages using checkbox in JSP  Am working on a Mail Server Project. In that I have Inbox And Outbox Messages. Now Each and Every message...;input type="checkbox" name="inboxchk" value="<%=rs.getInt("omailid")%>">
Syntax for image selection Urgent - JSP-Servlet
Syntax for image selection Urgent  Respected Sir/Madam, I am using the following syntax to know whether radio button has been clicked or not: for(var i=0;i  Hi friend, now show the question no 2129 Here
Image Selection Reply Urgent.. - JSP-Servlet
Image Selection Reply Urgent..  Respected Sir/Madam, I am R.Ragavendran.. Thanks for yuor fast response.. Sir actually I will be much more convenient if you provide me with coding.. I dont know to work with images as i
Program Arrow selection Most Urgent - JSP-Servlet
Program Arrow selection Most Urgent  Respected Sir/Madam, I am R.Ragavendran.. I got your coding which is highly appreciable.. As per my requiremennt,there are image buttons for each row in the database.. But i am
How to create textbox on combo value selection using javacsript in jsp?
How to create textbox on combo value selection using javacsript in jsp?  dynamically create textbox on combo value selection. when select multiple values then create multiple textboxes
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  how to insert check box value to the database using jsp my code is <link href...; <td align="center"> <input type="checkbox
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  How to insert check box value to the oracle database using jsp? I want to create hotel's... for="pack_meal"></label> <input type="checkbox
how to insert checkbox value into database using jsp
;   Here is a simple jsp code that insert the selected checkbox values...how to insert checkbox value into database using jsp  How to insert check box value to the oracle database using jsp? I want to create hotel's
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
Display JSP selected listbox and checkbox in xml-please help me
Display JSP selected listbox and checkbox in xml-please help me  Hi, I have three Listbox on my jsp page. I want to do following: ByDefault first... from 1st list box second will fill accordingly by database using jsp. When user
Image selection instead of radio button very urgent.. - JSP-Servlet
Image selection instead of radio button very urgent..  Respected Sir/Madam, I am R.Ragavendran.. Actually in the following using radio... successfully. But I need some icon or some pictorial selection instead
Checkbox method
Checkbox method  what is the method to check if the checkbox is checked
JSP - Checkbox remain checked although checked values should depend on values stored in a stateful session bean
JSP - Checkbox remain checked although checked values should depend on values.... There are 3 JSP pages, shop1.jsp , shop2.jsp and shop3.jsp where each of these pages... displays all of the items selected. The selection of items is made using checkboxes
sir plz help in design a jsp page whichis as follow username [_____] select [__>]password [_____] after selection then onlypassword text box is visible
sir plz help in design a jsp page   sir plz help in design a jsp page which is as follow username [ _ ] select [ > ] password [ _ ] after selection then only password text box is visible
Maintain checked checkbox status
Maintain checked checkbox status  Hi everyone In my JSP application, i have database table stored in mysql. when i display there recors using... ultimate aim is to avoid "duplicate " selection of checkbox records . i am stuck
UIButton checkbox
UIButton checkbox  iPhone UIButton checkbox example required.. can any one please explain me.. how to create a checkbox button using UIButton in XIB
single selection of chechbox among multiple selection when in a loop.
single selection of chechbox among multiple selection when in a loop. ... that when in a loop i trying to choose single checkbox among multiple checkboxes but here am getting multiple selection(previous selected item also coming again
Checkbox
Checkbox       A checkbox is again a label which is displayed as a pushbutton as shown in the example... of the checkbox is either true or false. However, the initial state is false
Advertisements
 

 

 

DMCA.com