This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Fetching one table cell click and passing it to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Fetching one table cell click and passing it to servlet

Navya J Nair
Greenhorn

Joined: Apr 04, 2012
Posts: 15
Hi All,

Please help !!!

I am building a TicTacToe game web-services application using jsp and servlet where I need to extract the table's cell onclick event each time for each user and pass is to servlet.

The code so far I have built is :

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

<body>
<form action="TicTacToeGame" method="post">

<table id="board" border=1 align=left cellpadding="2" cellspacing="3" width="250" height="250" >
<tr>
<td> <input type="button" name="11" /> </td>
<td> <input type="button" name="12" /> </td>
<td> <input type="button" name="13" /> </td>
</tr>
<tr>
<td> <input type="button" name="21" /> </td>
<td> <input type="button" name="22" /> </td>
<td> <input type="button" name="23" /> </td>
</tr>
<tr>
<td> <input type="button" name="31" /> </td>
<td> <input type="button" name="32" /> </td>
<td> <input type="button" name="33" /> </td>
</table>
<div>
<input type="submit" name="submit" value="MyMove">
</div>

</form>
</body>

</html>
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4339
    
    7

Please don't post the same message to multiple forums. Thanks!

Duplicate of http://www.coderanch.com/t/573099/Servlets/java/Fetching-one-table-cell-click
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Fetching one table cell click and passing it to servlet
 
Similar Threads
how show values in jsp from getting database
Getting error
How to getParameter value
How can i get selected radio button value using jsp
Doubts in jsp