469,578 Members | 1,742 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

Newbie needs asp help

2
Project to do simulation testing (me teacher). Page one writes in real time to page two...both displayed at sam time with frames. Code below. Problem...I want to keep score. Each choice needs a value between (-3 and 3) to be summed for final score. second problem, I want checkbox to be permanent, that is once selected no unselect. Thanks fro your help. also, all on a windows server asp willing to go with php, java etc.


Page one code........

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <base target="main">
  3.  
  4. <%
  5. dim dmaking
  6. dmaking=Request.Form("dmaking")
  7. %>
  8. <body>
  9. <form action="ben2.asp" method="post">
  10. <p>Which measures do you wish to assess?</p>
  11.  
  12. <input type="checkbox" name="dmaking" value="40 breaths per minute" onclick="this.form.submit();">Respiratory Rate
  13. <br />
  14.  
  15.  
  16. <input type="checkbox" name="dmaking" value="</br> 200/140" onclick="this.form.submit();">Blood Pressure
  17. <br />
  18.  
  19.  
  20. <input type="checkbox" name="dmaking" value="</br> 188 beats per minute" onclick="this.form.submit();">Heart rate
  21.  
  22. <br />
  23.  
  24. <input type="checkbox" name="dmaking" value="</br> Blue"  onclick="this.form.submit();">Color
  25.  
  26. <br />
  27.  
  28. <input type="checkbox" name="dmaking" value="</br> Doctor disagrees"  onclick="this.form.submit();">Cat Scan
  29.  
  30. <br />
  31.  
  32. <input type="checkbox" name="dmaking" value="</br> Doctor disagrees"  onclick="this.form.submit();">Brain surgery 
  33.  
  34. <p> 
  35.  
  36. <br />
  37.  
  38. <a target="_self" href="#section2">click here to go to section 2</a> </p>
  39.  
  40. <p>&nbsp;</p>
  41.  
  42.  
  43. <p>&nbsp;</p>
  44.  
  45.  
  46. <p>&nbsp;</p>
  47.  
  48.  
  49. <p>&nbsp;</p>
  50.  
  51.  
  52. <p>&nbsp;</p>
  53.  
  54.  
  55. <p>&nbsp;</p>
  56.  
  57.  
  58. <p>&nbsp;</p>
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. <a name="section2"> Welcome To the next Section 2</a>
  66.  
  67.  
  68.  
  69. <p>Which intervention is most appropriate?</p>
  70.  
  71. <p>Select only one unless instructed to choose another.</p>
  72.  
  73. <input type="checkbox" name="infogathering" value="Doctor disagrees Nasal canula not ordered" onclick="this.form.submit();">Nasal Canual
  74. <br />
  75.  
  76.  
  77. <input type="checkbox" name="infogathering" value="<br /> Doctor disagrees Non rebreathing Mask not ordered" onclick="this.form.submit();">Non rebreathing Mask
  78. <br />
  79.  
  80.  
  81. <input type="checkbox" name="infogathering" value="<br /> Non rebreathing Mask" onclick="this.form.submit();">Heart rate
  82.  
  83. <br />
  84.  
  85. <input type="checkbox" name="infogathering" value="<br /> Doctor just left the building"  onclick="this.form.submit();">Send to real hospital
  86.  
  87. <br />
  88.  
  89. <input type="checkbox" name="infogathering" value="<br /> Doctor disagrees dip stick"  onclick="this.form.submit();"> Bronchodialator therapy
  90.  
  91. <br />
  92.  
  93. <input type="checkbox" name="infogathering" value="<br /> Doctor disagrees Brain surgery just plain stupid"  onclick="this.form.submit();">Brain surgery 
  94.  
  95. <br />
  96.  
  97.  
  98. <%
  99. if dmaking<>"" then
  100. Response.Write("<p> " & dmaking & "</p>")
  101. end if
  102. %>
  103.  
  104. </form>
  105. &nbsp;</body></html>



Page two...........
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <meta http-equiv="Content-Language" content="en-us">
  3.  
  4. <%
  5. dim infogathering
  6. infogathering=Request.Form("infogathering")
  7. %>
  8.  
  9. <%
  10. dim dmaking
  11. dmaking=Request.Form("dmaking")
  12. %>
  13.  
  14. <body>
  15.  
  16. <p>Responses to your choices:</p>
  17. <%
  18. if infogathering<>"" then
  19. Response.Write("<p> " & infogathering & "</p>")
  20. end if
  21.  
  22. if dmaking<>"" then
  23. Response.Write("<p> " & dmaking & "</p>")
  24. end if
  25. %>
  26.  
  27. </body>
  28. </html>
Nov 18 '08 #1
3 1754
jhardman
3,406 Expert 2GB
So which part is giving you trouble? coding frames? Picking the technology to code the page in the first place? ASP is a fair choice for this project, but you will need some javascript to go along with it.

BTW, when you post code, please use [ code]...[/code] tags (you can use the # button on the post page)

Jared
Nov 19 '08 #2
milov
2
Thanks for taking the time to reply. The pages work fine except I don't know how to make checkbox once checked permanent (until simulation run again) and I don't know how to get the variable to have a numeric value and then how to sum those values at the with a final submit at the bottom of page one. Thanks for the tip on posting code.
Nov 19 '08 #3
jhardman
3,406 Expert 2GB
Thanks for taking the time to reply. The pages work fine except I don't know how to make checkbox once checked permanent (until simulation run again) and I don't know how to get the variable to have a numeric value and then how to sum those values at the with a final submit at the bottom of page one. Thanks for the tip on posting code.
For the first, I would use javascript. I think I could get it to work, but I'm not really a javascript expert, so I'm not sure I would take my advice, but it goes something like this:
Expand|Select|Wrap|Line Numbers
  1. <input type="checkbox" name="thisCheckBox" onClick="this.Disabled='true'">
This could get you started, but it would probably be better to have the onclick attribute go to a stand-alone function that disables the checkbox. If that is something you need help with, please ask. If I can't get it to work for you, I can probably recommend someone else to do it.

For the second question, I'm still not sure I understand you. Is this something you want the web page to calculate before you submit the page? If so, it can all be done with javascript. Each checkbox clicked would pass a value to a javascript function, the function passes the number to a variable and when you submit, the submit sends that value to the form handler. Does this make sense?

ASP really only works while the page is loading. If you want the totalling to be done after submitting (and there would be no way for users to find your code) then you should use ASP for that part. Each checkbox selected passes its value attribute on to the form handler. Does this make sense?

Jared
Nov 19 '08 #4

Post your reply

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

Similar topics

reply views Thread by igmox | last post: by
2 posts views Thread by Luis Speciale | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.