Simple Terms and Condition Dialog in PHP
Submitted by rinvizle on Tuesday, November 22, 2016 - 10:58.
Simple Terms and Condition Dialog is a simple PHP application. This application creates a dialog to prompt the user if he/she agreed to the Terms and Condition of the websites. If the user doesn't agree on the Website conditions they can't proceed or enter the website without enabling the submit button by clicking the agree button.
This short script is for the function and condition of the application from the button to enable.
Hope that you learn in this simple tutorial. Don't forget to LIKE & SHARE this website.
Sample Code
Index.php - This is for the UI of the dialog and for the other functions of the application.- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <script src="js/jquery.min.js"></script>
- </head>
- <body>
- <div class="container">
- <h1 align="center">Terms and Condition!</h1><hr>
- <div class="license">
- Introduction
- These Website Standard Terms and Conditions written on this webpage shall manage your use of this website. These Terms will be applied fully and affect to your use of this Website. By using this Website, you agreed to accept all terms and conditions written in here. You must not use this Website if you disagree with any of these Website Standard Terms and Conditions.
- <br><br>Minors or people below 18 years old are not allowed to use this Website.
- </div>
- <table>
- <tr>
- <td><input type="radio" name="terms" value="agree" id="agree"></td>
- <td>I Agree With The Terms And Condition.</td>
- </tr>
- <tr>
- <td><input type="radio" name="terms" value="not_agree" id="not_agree" checked></td>
- <td>I Do Not Agree With The Terms And Condition.</td>
- </tr>
- <tr>
- <td><br/></td>
- </tr>
- <tr>
- <td><input type="submit" name="submit" value="Submit" id="submit"></td>
- <td><input type="button" name="cancel" value="Cancel"></td>
- </tr>
- </table>
- </div>
- </body>
- </html>
- <script type="text/javascript">
- $(function(){
- var btnSubmit = $('#submit');
- btnSubmit.attr('disabled', 'disabled');
- $('input[name=terms]').change(function(e){
- if($(this).val() == 'agree'){
- btnSubmit.removeAttr('disabled');
- }else{
- btnSubmit.attr('disabled', 'disabled');
- }
- });
- });
- </script>
Add new comment
- 2636 views