javascript - Semantic-ui Checkboxes and buttons check on PHP -


semantic-ui uses jquery , javascript. when use jquery checkbox, , check it, adds 'checked' class it.

the problem is, want use php's isset() function, know if checkbox checked or not, because checkbox isn't checked, cant.

how can identify checked semantic-ui checkbox on php? thank you.

form:

<form class="ui form" action="your_action.php" method="post">    <div class="field">     <label>first name</label>       <input type="text" name="first-name" placeholder="first name">    </div>       <div class="field">    <div class="ui checkbox">      <input name='check' type="checkbox" tabindex="0" class="hidden">     <label>i agree terms , conditions</label>    </div>  </div>   <button name='action' value="submit" class="ui button" type="submit">submit</button> </form> 

your_action.php

simply check checkbox :

if ($_request['action'] == 'submit') {     if(isset($_request['check']) , $_request['check'] == 'on') {        //do stuff     } 

if want check within javascript use checkbox's "is checked" behaviour

$('.ui.checkbox').checkbox(<i>behavior</i>, argumentone, argumenttwo...); 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -