skip to Main Content

name="submit" works normally like it should

if(isset($_POST["submit"]))

<input type="submit" ID="asdf" name="submit" value="Save" class="ui blue mini button"> 

I will like to use the ID element instead

if(isset($_POST["asdf"]))

<input type="submit" ID="asdf" name="submit" value="Save" class="ui blue mini button">

i dont know how to do this, i have tried if(isset($_POST["#asdf"])) no luck

2

Answers


  1. No, you cannot access the ID of the element in the $_POST array, only the name. If you do this:

    print_r( $_POST )

    You will see the key that can be accessed, and their values.

    Login or Signup to reply.
  2. IDs are not passed in a form submission. You can, however, have multiple <input type="submit"> fields with different names, and act accordingly.

    <input type="submit" name="asdf" value="Save" class="ui blue mini button"> 
    

    will give you a $_POST['asdf'] with value Save.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search