Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. PHP AND JavaScript

PHP AND JavaScript

Scheduled Pinned Locked Moved Web Development
questionjavascriptphphtmltools
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    progman
    wrote on last edited by
    #1

    I have Simple HTML FORM with SEVERAL submit buttons (have different behavior of this form processing). How Can i handle with them ? How can i see in my PhP (CGI) script, which button was submitted ? Thanks in advance !

    G 1 Reply Last reply
    0
    • P progman

      I have Simple HTML FORM with SEVERAL submit buttons (have different behavior of this form processing). How Can i handle with them ? How can i see in my PhP (CGI) script, which button was submitted ? Thanks in advance !

      G Offline
      G Offline
      Ghasrfakhri
      wrote on last edited by
      #2

      Hi You can Define your submit buttons as following then in your PHP code check like this switch($act /* or $_REQUEST['act']*/) { case "do1": //some code to handle first action break; case "do2": //some code to handle 2nd action break; case "do3": //some code to handle 3rd action } depend on the submit button has been clicked, the value of act will change. Iman Ghasrfakhri

      H 1 Reply Last reply
      0
      • G Ghasrfakhri

        Hi You can Define your submit buttons as following then in your PHP code check like this switch($act /* or $_REQUEST['act']*/) { case "do1": //some code to handle first action break; case "do2": //some code to handle 2nd action break; case "do3": //some code to handle 3rd action } depend on the submit button has been clicked, the value of act will change. Iman Ghasrfakhri

        H Offline
        H Offline
        hiral_shah
        wrote on last edited by
        #3

        you can do in another way too. You may have different forms for each submit button. If you have some common values for each forms then you can use javascript function for getting that value. You can pass different action case for each button.

        -------------------------------------------------------------------------------------------------- Hiral Shah India If you think that my answer is good enough and can be helpful for other then don't forget to vote. :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups