Mulitple button??

javascript United States
  • 19 years ago

    Hi, how do I have a few buttons, having each doing a different thing? 2 buttons are suppose to pass a string to a select statement in <body>, and another one acting as a submit button(this button is working fine). How do I make the 2 buttons (Group and Test Print) to pass on a string that gets into the select statement?? My code are below.. there's a mix of ASP and JS. Grateful for your advice please. Thank you.



    Response.Write "<form name='refr' method='POST' action='./recp.asp?action=upd'>"
    ...


    Response.Write "</table><p><input name='process' type='button' value='GROUP' onclick=transit('group')><input name='process' type='button' value='TEST PRINT' onclick=transit('tprint')><input name='process' type='submit' value='PRINT RECEIPTS'></p></form>"
    %>


    <script>
    function transit(para){
      if (para = 'group') {window.location.href = './recp.asp?reload'}
     else if (para = 'tprint'){window.location.href=./recp.asp?testit'}
    }
    </script>
    </head>


    <body>
    <%
    dim saction
    saction = cstr(Request.QueryString("action"))


    select case saction
     case "testit"
        response.write "<p> Test Print button clicked"
       
     case "reload"
        response.write "<p>Group button clicked"
           
     case "upd"
        response.write "<p>Print button clicked"


     end select
    ...
    %>

  • 19 years ago

    Okay.. nevermind. I've solved this problem. Thank you.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow