Newbie needs asp help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • milov
    New Member
    • Nov 2008
    • 2

    Newbie needs asp help

    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........

    Code:
    <html>
    <base target="main">
    
    <%
    dim dmaking
    dmaking=Request.Form("dmaking")
    %>
    <body>
    <form action="ben2.asp" method="post">
    <p>Which measures do you wish to assess?</p>
    
    <input type="checkbox" name="dmaking" value="40 breaths per minute" onclick="this.form.submit();">Respiratory Rate
    <br />
    
    
    <input type="checkbox" name="dmaking" value="</br> 200/140" onclick="this.form.submit();">Blood Pressure
    <br />
    
    
    <input type="checkbox" name="dmaking" value="</br> 188 beats per minute" onclick="this.form.submit();">Heart rate
    
    <br />
    
    <input type="checkbox" name="dmaking" value="</br> Blue"  onclick="this.form.submit();">Color
    
    <br />
    
    <input type="checkbox" name="dmaking" value="</br> Doctor disagrees"  onclick="this.form.submit();">Cat Scan
    
    <br />
    
    <input type="checkbox" name="dmaking" value="</br> Doctor disagrees"  onclick="this.form.submit();">Brain surgery 
    
    <p> 
    
    <br />
    
    <a target="_self" href="#section2">click here to go to section 2</a> </p>
    
    <p>&nbsp;</p>
    
    
    <p>&nbsp;</p>
    
    
    <p>&nbsp;</p>
    
    
    <p>&nbsp;</p>
    
    
    <p>&nbsp;</p>
    
    
    <p>&nbsp;</p>
    
    
    <p>&nbsp;</p>
    
    
    
    
    
    
    <a name="section2"> Welcome To the next Section 2</a>
    
    
    
    <p>Which intervention is most appropriate?</p>
    
    <p>Select only one unless instructed to choose another.</p>
    
    <input type="checkbox" name="infogathering" value="Doctor disagrees Nasal canula not ordered" onclick="this.form.submit();">Nasal Canual
    <br />
    
    
    <input type="checkbox" name="infogathering" value="<br /> Doctor disagrees Non rebreathing Mask not ordered" onclick="this.form.submit();">Non rebreathing Mask
    <br />
    
    
    <input type="checkbox" name="infogathering" value="<br /> Non rebreathing Mask" onclick="this.form.submit();">Heart rate
    
    <br />
    
    <input type="checkbox" name="infogathering" value="<br /> Doctor just left the building"  onclick="this.form.submit();">Send to real hospital
    
    <br />
    
    <input type="checkbox" name="infogathering" value="<br /> Doctor disagrees dip stick"  onclick="this.form.submit();"> Bronchodialator therapy
    
    <br />
    
    <input type="checkbox" name="infogathering" value="<br /> Doctor disagrees Brain surgery just plain stupid"  onclick="this.form.submit();">Brain surgery 
    
    <br />
    
    
    <%
    if dmaking<>"" then
    Response.Write("<p> " & dmaking & "</p>")
    end if
    %>
    
    </form>
    &nbsp;</body></html>



    Page two...........
    Code:
    <html>
    <meta http-equiv="Content-Language" content="en-us">
    
    <%
    dim infogathering
    infogathering=Request.Form("infogathering")
    %>
    
    <%
    dim dmaking
    dmaking=Request.Form("dmaking")
    %>
    
    <body>
    
    <p>Responses to your choices:</p>
    <%
    if infogathering<>"" then
    Response.Write("<p> " & infogathering & "</p>")
    end if
    
    if dmaking<>"" then
    Response.Write("<p> " & dmaking & "</p>")
    end if
    %>
    
    </body>
    </html>
    Last edited by jhardman; Nov 19 '08, 02:46 PM. Reason: added code tags - please note button marked #
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    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

    Comment

    • milov
      New Member
      • Nov 2008
      • 2

      #3
      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.

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Originally posted by milov
        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:
        Code:
        <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

        Comment

        Working...