473,320 Members | 2,097 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,320 software developers and data experts.

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

17
Dear Web application 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.  
Sep 22 '10 #1
1 1910
Haiyan
17
I figured out. I can send the checked checkbox to server side if I only use one form.
Sep 22 '10 #2

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.