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



Home Answers Viewqa JSP-Servlet Passing td cell id to servlet

Have Programming Question? Ask it here!
 
 
 


navya j nair
Passing td cell id to servlet
0 Answer(s)      2 years and 4 months ago
Posted in : JSP-Servlet


Hi all,

I am new to JSP/Servlet .Please help. I need to send the table cell index in servlet using javascript and should be able to make a cell index to have a text - "X" / "0"only once.

Here is my code sofar-

    function editTableCell(e)
    {
var player1=true;
var player2=true;
         var CellText = null;
         alert(e);
         var SelectedElement = document.getElementById(e);
         alert(SelectedElement);
         if(player1)
             {
           //e.innerHTML="X";
            SelectedElement.innerHTML = "X";
            //CellText = SelectedElement.innerHTML;   
             }
         else{
             SelectedElement = e;
                e.innerHTML = "0";
                CellText = e.innerHTML;
         }


    }

</script>
<style type="text/css">
body{
    text-align: center;
}
table{
    text-align: center;
    table-layout:fixed;
}
</style>
</head>

<body>
<div>
<form method="post" action="TicTacToeGame">
<table id="board" border=1 align=center cellpadding="2" cellspacing="3" width="250" height="250" >
<tr>
<td id="1" onClick="editTableCell(1)"></td>
<td id="2" onClick="editTableCell(2)"></td>
<td id="3" onClick="editTableCell(3)"> </td>
</tr>
<tr>
<td id="4" onClick="editTableCell(4)"></td>
<td id="5" onClick="editTableCell(5)"></td>
<td id="6" onClick="editTableCell(6)"> </td>
</tr>
<tr>
<td id="7" onClick="editTableCell(7)"></td>
<td id="8" onClick="editTableCell(8)"></td>
<td id="9" onClick="editTableCell(9)"> </td>
</table>
 <div><input type="submit" value="Move" name="Submit"></div>
</form>
</div>
</body>
</html>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Passing td cell id to servlet
Passing td cell id to servlet  Hi all, I am new to JSP/Servlet .Please help. I need to send the table cell index in servlet using javascript...;td id="1" onClick="editTableCell(1)"></td> <td id="2" onClick
Passing Parameters - JSP-Servlet
Passing Parameters  Hi I have to pass parameter like... Enter Email id... name is Email id
Advertisements
Passing Parameter - JSP-Servlet
Passing Parameter  I would like to ask how to pass a parameter from javascript section into the jsp section.It will be something like...; answer<%; <---I'm stuck here passing the var
passing parameters - JSP-Servlet
passing parameters  hi this is my jsp page Reserved By: Conference Hall No: Select Hall Numbers
passing values - JSP-Servlet
passing values  hi this is my jsp page Reserved By: Conference Hall No: Select Hall Numbers Time Slot: Select Time Slot Date
Passing Parameter - JSP-Servlet
Passing Parameter  Hi, it'me again. Below is the set of code that I get from your solution entitled droplist that read from database. It do read from database but in the textbox of the webpage, i need it to show something
Passing value in hyperlink - JSP-Servlet
Passing value in hyperlink  How to pass value in anchor tag or HTML...="0"><tr><td width="100%"><form method="...;<td width="50%" valign="right"><b>User ID<
percentage values for <TD WIDTH=...>
percentage values for   Can I use percentage values for <TD WIDTH=...>
Usage of Session Id in servlet - Servlet Interview Questions
Usage of Session Id in servlet   Hi friends, I am beginner in servlets, without session Id can we do any operations like add,update,edit,delete. I saw Session id is loaded for edit and delete action not for add
passing the form values with image upload - JSP-Servlet
passing the form values with image upload  Hii . I want to get the solution for passing values with an image uploading form. I cant access... : 2. Enter value for field 2: 3. Upload file : and in your servlet you can
passing from 1 jsp to another - JSP-Servlet
passing from 1 jsp to another  Hi Sir, What are the ways and means of passing from 1 jsp page to another page.what are the different types of methods?  Hi Friend, You can use tag,sedRedirect() method
Need to expand tree by passing Id thr URL. (not by clicking manually) - Java Server Faces Questions
Need to expand tree by passing Id thr URL. (not by clicking manually)  Sub: Need to expand tree by passing Id thr URL. Hi, Here i have...=tree&albumIds=1001,1002,1005,1008,1009,1010&client=0" I m passing album Ids
Need to expand tree by passing Id thr URL. - Java Server Faces Questions
Need to expand tree by passing Id thr URL.  Hi, Here i have...=tree&albumIds=1001,1002,1005,1008,1009,1010&client=0" I m passing album Ids... by passing the clientId from Url. How can I do it. Plz help asap
passing value from javascript to jsp - JSP-Servlet
passing value from javascript to jsp  Hi... Is there any way to get the value from the javascript and print it on the current jsp page or print an array onto the current jsp page using javascript  Hi Friend, We
passing value fron script to scriplet - JSP-Servlet
passing value fron script to scriplet  how to pass value from Java script to Scriplet in jsp  Hi friend, if you want to pass something from the client (javaScript) to the server (java), you have to submit a form
How to get an Id vaue - JSP-Servlet
How to get an Id vaue  Dear Sir, Thanks for posting... or delete etc button i have to go that page and i want that selected id value... In form action their is a servlet action when i clickon a button
id
id  how to find date of birth and gender in id in html with the help of javascript
Validate Domain of an Email Id - JSP-Servlet
Validate Domain of an Email Id  How to validate the domain name in an Email id before sending a mail for an application using Mail API. ex: a@a.com in the above email id i want to validate whether a.com is present
How to get an Id vaue - JSP-Servlet
How to get an Id vaue  Dear Sir , How to get an Id value of a column when it is select ,i have to get an perticular rows Id value .I have a table with attributes like select,Id,subject,matter,status...If i select a one
Validating Emp ID Reply - JSP-Servlet
Validating Emp ID Reply  Respected Sir/Madam, I am Ragavendran.R.. Thanks for your quick response.. Actually I need to check whether Emp ID...("Employee ID cannot be null"); form.id.focus(); return false; } if(form.name.value
Passing java variables from JSP to Servlet - return null values
Passing java variables from JSP to Servlet - return null values  I want to pass some variables from a JSP page to a servlet. These variables are from... from JSP to servlet gives null values. I got msg=null. Is there another way
Parameter passing from jsp page to jsp page - JSP-Servlet
Parameter passing from jsp page to jsp page  Hi I intends to pass the parameters that I received from previous page through query String. I get all parameter in respective string variables. I have to passed the parameters
differences between cell spacing and cell padding
differences between cell spacing and cell padding  What are the differences between cell spacing and cell padding
css table cell margin
css table cell margin  How can i put margin between two columns(cell... this css into your td to set the margin between cells. See how you can include it in your code. <table> <tr> <td style="padding-right:10px">
Passing variable
Passing variable  How to pass variable to HTTP object in HTMl or PHP
Table Empty Cell in HTML
Table Empty Cell in HTML       The Table Empty Cell in HTML define no content inside a cell of table. The code is not able to display border around the empty cell in a table
change content of cell javascript
change content of cell javascript  change content of cell javascript
Session ID
Session ID  How can I change the session ID of the page?   The servlet session represents a relationship between the servlet container...' session ID values because it is very likely to result in the loss of the session
Custom Cell View UITableview
Custom Cell View UITableview  How can i get two custom cell view in UITableView
Passing classid or name in request using Jquery
Passing classid or name in request using Jquery  Hi, I am new to JQuery.I have a servlet that I am calling using jquery.I have some parameters like filename,userid that I am passing to the servlet to upload a file.I have created
editing cell in a table - JDBC
editing cell in a table  how can i edit a cell in a table and save the change to a database  Hi Friend, Try the following code: 1)updateDatabase.jsp RollNo Name Class "> "> ">
Argument Passing
Passing Argument in Java  hi this is my code class Test { void meth(int i, int j) { i *= 2; j /= 2; System.out.println("a=" +i); System.out.println("b=" +j); } } public
VoIP Cell Phone
, the InternetTalker recognizes the cell phone caller ID and immediately links the caller to the VoIP network. The InternetTalker can recognize up to three cell-ID... VoIP Cell Phone Using VoIP with Cell Phone  Before many
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't... servlet and get articale name, i wont to this name catgorice parametor and after
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't... servlet and get articale name, i wont to this name catgorice parametor and after
Height for cell in table view - UITableView
Height for cell in table view - UITableView  UITableview height for cell What is the height for cell in table view iPhone mobile application
Display of value in Tabel cell
in the table cell by defining the cell editor.The cell is having a text field and calendar.When i select a date in the calendar the date will be displayed in the cell...) The format the cell is showing when its in focus - Mon,dd,yyyy(Mar,01,2011). I
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
row_id
row_id  sir i have created a table my_table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row and third column's name in sql server 2005 , kindly send me the query
image on div or cell of table
image on div or cell of table  I am using ms access database and I have stored the image in access database and I have a code to display image but it display on browser but I want to display on inside the div tag or table tag pls
image on div or cell of table
image on div or cell of table  I am using ms access database and I have stored the image in access database and I have a code to display image but it display on browser but I want to display on inside the div tag or table tag pls
image on div or cell of table
image on div or cell of table  I am using ms access database and I have stored the image in access database and I have a code to display image but it display on browser but I want to display on inside the div tag or table tag pls
image on div or cell of table
image on div or cell of table  I am using ms access database and I have stored the image in access database and I have a code to display image but it display on browser but I want to display on inside the div tag or table tag pls
image on div or cell of table
image on div or cell of table  I am using ms access database and I have stored the image in access database and I have a code to display image but it display on browser but I want to display on inside the div tag or table tag pls
image on div or cell of table
image on div or cell of table  I am using ms access database and I have stored the image in access database and I have a code to display image but it display on browser but I want to display on inside the div tag or table tag pls
total id
total id  how to print and total my id number ..for example if my id is 0123456789 the output will look like this : 0123456789 0+1+2+3+4+5+6+7+8+9=45 help me plz
Passing array element
Passing array element  What about passing an element of an array? If I have array of objects and pass functionA(arr[2]); Then functionA() will get arr[2] as a value type or a reference type
id creation
id creation  CREATE TABLE mohan2 ( sno bigint(20) NOT NULL AUTO_INCREMENT, name varchar(30) NOT NULL, sal int(30) NOT NULL, eid varchar(30) NOT NULL, PRIMARY KEY (sno,eid) ) import java.sql.*; import
Java parameter passing
Java parameter passing  What type of parameter passing does Java support
id generation
id generation  CREATE TABLE `mohan2` ( `sno` bigint(20) NOT NULL... to employee id automatically generate please try this code, useful for u thanks ...");%> any body want to employee id automatically generate please try
Advertisements
 

 

 

DMCA.com