vendredi 11 septembre 2015

Using isset from a name of an input

I am not sure if I am going about this correctly. I have a set of checkbox inputs. If someone selects the last check box all_users_check, I want a new form to appear where I will be listing all of the users in a drop down (haven't added the drop down yet). I thought I could do this by using the name of the input, but I am mistaken apparently as I am getting this error..

Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead)

How else could I structure what I am doing so that if someone checks that option the new form displays?

<form action="">
 <input type="checkbox" name="spectator_check" value=""> Spectators<br>
  <input type="checkbox" name="member_check" value="" checked> Team Members<br>
  <input type="checkbox" name="commissioner_check" value="" checked> Commissioner(s)<br>
  <input type="checkbox" name="all_users_check" value="" checked> Individual User<br>
</form>

<?php
    if(isset(['all_users_check'])) {

?>
<form action="">
  <input type="checkbox" name="spectator_check" value=""> Spectators<br>
  <input type="checkbox" name="member_check" value="" checked> Team Members<br>
  <input type="checkbox" name="commissioner_check" value="" checked> Commissioner(s)<br>
  <input type="checkbox" name="all_users_check" value="" checked> Individual User<br>
</form>

<?  
    }

?>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire