473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to return a matrix of checkbox from client to server side?

17
Dear Python experts:
I am trying to use Cherrypy to do one web application. I used the cheetah template to generate the HTML file for a matrix of checkbox, and hope to return the checked checkbox information to server side. Because I already used the form for quick selection, and HTML doesn't support nested form. Could you please point me to right way to get the checked checkbox information to server side for handling?
Following is the HTML code generated by cheetah and you can save as *.html and open with internet browser.
Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <HEAD>
  3. <TITLE>TRY</TITLE>
  4.  
  5. <STYLE type="text/css">
  6. body {background-color: "lightyellow";}
  7. </STYLE>
  8.  
  9. </HEAD>
  10. <BODY>
  11.  
  12. <script language=JavaScript>
  13.  
  14. function select_all_onclick() {
  15.    document.SelectSlot1.select_slot1.checked = document.SelectAll.select_all.checked
  16.    document.SelectSlot2.select_slot2.checked = document.SelectAll.select_all.checked
  17.    document.SelectSlot3.select_slot3.checked = document.SelectAll.select_all.checked
  18.    document.SelectBoat1.select_boat1.checked = document.SelectAll.select_all.checked
  19.     document.SelectBoat1Slot1.boat1_slot1.checked = document.SelectAll.select_all.checked
  20.     document.SelectBoat1Slot2.boat1_slot2.checked = document.SelectAll.select_all.checked
  21.     document.SelectBoat1Slot3.boat1_slot3.checked = document.SelectAll.select_all.checked
  22.    document.SelectBoat2.select_boat2.checked = document.SelectAll.select_all.checked
  23.     document.SelectBoat2Slot1.boat2_slot1.checked = document.SelectAll.select_all.checked
  24.     document.SelectBoat2Slot2.boat2_slot2.checked = document.SelectAll.select_all.checked
  25.     document.SelectBoat2Slot3.boat2_slot3.checked = document.SelectAll.select_all.checked
  26.    document.SelectBoat3.select_boat3.checked = document.SelectAll.select_all.checked
  27.     document.SelectBoat3Slot1.boat3_slot1.checked = document.SelectAll.select_all.checked
  28.     document.SelectBoat3Slot2.boat3_slot2.checked = document.SelectAll.select_all.checked
  29.     document.SelectBoat3Slot3.boat3_slot3.checked = document.SelectAll.select_all.checked
  30. }
  31.  
  32. function select_boat1_onclick(){
  33.     document.SelectBoat1Slot1.boat1_slot1.checked = document.SelectBoat1.select_boat1.checked
  34.     document.SelectBoat1Slot2.boat1_slot2.checked = document.SelectBoat1.select_boat1.checked
  35.     document.SelectBoat1Slot3.boat1_slot3.checked = document.SelectBoat1.select_boat1.checked
  36. }
  37. function select_boat2_onclick(){
  38.     document.SelectBoat2Slot1.boat2_slot1.checked = document.SelectBoat2.select_boat2.checked
  39.     document.SelectBoat2Slot2.boat2_slot2.checked = document.SelectBoat2.select_boat2.checked
  40.     document.SelectBoat2Slot3.boat2_slot3.checked = document.SelectBoat2.select_boat2.checked
  41. }
  42. function select_boat3_onclick(){
  43.     document.SelectBoat3Slot1.boat3_slot1.checked = document.SelectBoat3.select_boat3.checked
  44.     document.SelectBoat3Slot2.boat3_slot2.checked = document.SelectBoat3.select_boat3.checked
  45.     document.SelectBoat3Slot3.boat3_slot3.checked = document.SelectBoat3.select_boat3.checked
  46. }
  47.  
  48. function select_slot1_onclick(){
  49.     document.SelectBoat1Slot1.boat1_slot1.checked = document.SelectSlot1.select_slot1.checked
  50.     document.SelectBoat2Slot1.boat2_slot1.checked = document.SelectSlot1.select_slot1.checked
  51.     document.SelectBoat3Slot1.boat3_slot1.checked = document.SelectSlot1.select_slot1.checked
  52. }
  53. function select_slot2_onclick(){
  54.     document.SelectBoat1Slot2.boat1_slot2.checked = document.SelectSlot2.select_slot2.checked
  55.     document.SelectBoat2Slot2.boat2_slot2.checked = document.SelectSlot2.select_slot2.checked
  56.     document.SelectBoat3Slot2.boat3_slot2.checked = document.SelectSlot2.select_slot2.checked
  57. }
  58. function select_slot3_onclick(){
  59.     document.SelectBoat1Slot3.boat1_slot3.checked = document.SelectSlot3.select_slot3.checked
  60.     document.SelectBoat2Slot3.boat2_slot3.checked = document.SelectSlot3.select_slot3.checked
  61.     document.SelectBoat3Slot3.boat3_slot3.checked = document.SelectSlot3.select_slot3.checked
  62. }
  63.  
  64.  
  65. </script>      
  66.  
  67.  
  68. <table border="1" align = "center" bgcolor = "lightblue">
  69. <thead>
  70. <TR>
  71.   <TD width=150 align = "center">
  72.   <form name = SelectAll method="POST">
  73.  
  74.   <label>ALL Boats_Slots<input name = "select_all" type = "checkbox" value = "select_all" onclick = "select_all_onclick()"></label>
  75.   </form>
  76.   </TD>
  77.   <TD width=150 align = "center">
  78.   <form name = SelectBoat1 method="POST">
  79.   <label>657762<input name = "select_boat1" type = "checkbox" value = "select_boat1" onclick = "select_boat1_onclick()"></label>
  80.   </form>
  81.   </TD>
  82.  
  83.   <TD width=150 align = "center">
  84.   <form name = SelectBoat2 method="POST">
  85.   <label>657770<input name = "select_boat2" type = "checkbox" value = "select_boat2" onclick = "select_boat2_onclick()"></label>
  86.   </form>
  87.   </TD>
  88.   <TD width=150 align = "center">
  89.   <form name = SelectBoat3 method="POST">
  90.   <label>657775<input name = "select_boat3" type = "checkbox" value = "select_boat3" onclick = "select_boat3_onclick()"></label>
  91.  
  92.   </form>
  93.   </TD>
  94. </TR>
  95. </thead>
  96. <tbody>
  97. <TR>
  98.  <form name = SelectSlot1 method="POST">
  99.  <TD width=150 align = "center"><label>Slot_1<input name = "select_slot1" type = "checkbox" value = "select_slot1" onclick = "select_slot1_onclick()"></label></TD>
  100.  </form>
  101.  <form name = SelectBoat1Slot1 method="POST">
  102.  
  103.  <TD width=150 align = "center"><label><input name = "boat1_slot1" type = "checkbox" value = boat1_slot1></label></TD>
  104.  </form>
  105.  <form name = SelectBoat2Slot1 method="POST">
  106.  <TD width=150 align = "center"><label><input name = "boat2_slot1" type = "checkbox" value = boat2_slot1></label></TD>
  107.  </form>
  108.  <form name = SelectBoat3Slot1 method="POST">
  109.  <TD width=150 align = "center"><label><input name = "boat3_slot1" type = "checkbox" value = boat3_slot1></label></TD>
  110.  </form>
  111. </TR>
  112.  
  113. <TR>
  114.  <form name = SelectSlot2 method="POST">
  115.  <TD width=150 align = "center"><label>Slot_2<input name = "select_slot2" type = "checkbox" value = "select_slot2" onclick = "select_slot2_onclick()"></label></TD>
  116.  </form>
  117.  <form name = SelectBoat1Slot2 method="POST">
  118.  <TD width=150 align = "center"><label><input name = "boat1_slot2" type = "checkbox" value = boat1_slot2></label></TD>
  119.  </form>
  120.  <form name = SelectBoat2Slot2 method="POST">
  121.  <TD width=150 align = "center"><label><input name = "boat2_slot2" type = "checkbox" value = boat2_slot2></label></TD>
  122.  
  123.  </form>
  124.  <form name = SelectBoat3Slot2 method="POST">
  125.  <TD width=150 align = "center"><label><input name = "boat3_slot2" type = "checkbox" value = boat3_slot2></label></TD>
  126.  </form>
  127. </TR>
  128. <TR>
  129.  <form name = SelectSlot3 method="POST">
  130.  <TD width=150 align = "center"><label>Slot_3<input name = "select_slot3" type = "checkbox" value = "select_slot3" onclick = "select_slot3_onclick()"></label></TD>
  131.  </form>
  132.  
  133.  <form name = SelectBoat1Slot3 method="POST">
  134.  <TD width=150 align = "center"><label><input name = "boat1_slot3" type = "checkbox" value = boat1_slot3></label></TD>
  135.  </form>
  136.  <form name = SelectBoat2Slot3 method="POST">
  137.  <TD width=150 align = "center"><label><input name = "boat2_slot3" type = "checkbox" value = boat2_slot3></label></TD>
  138.  </form>
  139.  <form name = SelectBoat3Slot3 method="POST">
  140.  <TD width=150 align = "center"><label><input name = "boat3_slot3" type = "checkbox" value = boat3_slot3></label></TD>
  141.  </form>
  142.  
  143. </TR>
  144. </tbody>
  145. </table>
  146.  
  147. </BODY>
  148. </HTML>
  149.  
Thank you very much in advance!
Best Regards,
Haiyan
Sep 21 '10 #1
3 1739
Haiyan
17
I figured out. I can send the checked checkbox to server side if I only use one form.
Sep 22 '10 #2
bvdet
2,851 Expert Mod 2GB
I am glad you were able to figure it out. I would have responded if I knew the answer. :) BV
Sep 22 '10 #3
Haiyan
17
Hi, Bvdet:

Thanks a lot!

Haiyan
Sep 23 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Stop Bsod | last post by:
Hello, I'm quite a newbie in XML. What I wanted to do is just a simple web page (html or xhtml) that use XML. The point of the page is to show all my links/bookmarks, wherever I want to see them...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
2
by: DesignerX | last post by:
Just to insure that my application would work as expected with older and inferior browsers I set the enableclientscript of my validators to false. The validators and the input boxes they check are...
7
by: ap | last post by:
Hi, It is a quick question... Is that impossible to print the page(Web Form .aspx file) in client side using GDI+ like PrintDocument pd = new PrintDocument(); pd.print(); As I know it is a...
1
by: Chris | last post by:
Hi, 1) is it possible for an asp-button control to execute client-side scripting as well ? 2) and for an HTML-server control ? I would like to execute client-side code , and then execute...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
7
by: jtfaulk | last post by:
I need to encode some information on the server side using ASP.NET with C#; sending via HTTP to a client side application, that needs to be decoded in an MFC C++ application. I'm not sure if I...
6
by: den 2005 | last post by:
Hi everybody, Question 1: How do you set the values from server-side to a client-side control or how do you execute a javascript function without a button click event? Question 2: How do you...
2
by: =?Utf-8?B?TmV0d29yeHBybw==?= | last post by:
Whenever an ASP.NET server-side control is processed, the client form is repainted from the top forcing users to scroll back to where they were on long forms. How can I work around this issue?
4
by: =?Utf-8?B?TmV0d29yeHBybw==?= | last post by:
Whenever an ASP.NET server-side control is processed, the client form is repainted from the top forcing users to scroll back to where they were on long forms. How can I work around this issue? ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.