Jump to content

ephdee

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ephdee

  • Rank
    Member
  1. I want the modal to show after the user has fill the form, But don't know how to do that. Am very new in javascript. After the user have fill the form and click on the proceed button the modal should pop up but if the user did not fill all the form the modal should not display and and an error message should alert.. When the modal display then the user should fill the 1st modal form with a code 123456, if the user did not put anything or give a wrong code the 2nd modal should not show but if he/she does it should display. THIS IS THE HTML FORM <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"> <div align="center"> <p> Funds Transfer </h3> </div> <div class="panel-body"> <div align="center"> <p> Bank of lgbt Funds Transfer Service makes it easy to transfer funds to other beneficiaries within the bank or to other domestic bank.<br> To effect transfer of funds, please complete and submit the form below. Please note that all account numbers are required to be NUBAN compliant. </br> <div id="middle"> <table class=""> <tr> <th> <label for="funds transfr" >*Funds Transfer Type: </label> </th> <td><p> <select name="fundstransfr" maxlength="20" tabindex="108" > <option value=" "> </option> <option value="Internal">Internal</option> <option value="External">External</option> </select> </p> <p> </p> </td> <tr> <th> <label for= "transfr from" >*Transfer from: </label> </th> <td><p> <select name="transfrfrom" maxlength="20" tabindex="108"> <option value=" "> </option> <option value="Premier Account">Premier Account</option> <option value="Credit Card">Credit Card</option> </select> </p> <p> </p> </td> <td> </td> <td> </td> <tr> <th> <label for="amount">*Amount:</label> </th> <td> <p> <input type="number" name="amount" value="" placeholder="0.00" maxlength="30" size="12" tabindex="106"> </p> <p> </p></td> <td> </td> <td> </td> <tr> <th> <label for="Beneficiary Name">*Beneficiary Name:</label> </th> <td> <input type="text" name="BeneficiaryName" value="" maxlength="40" size ="30"tabindex="107"></td> <td><p> </p> <p> </p></td> <td> </td> <td colspan="2"> </td> </tr> <tr> <th> <label for="Beneficiary Bank" >*Beneficiary Bank:</label></th> <td><p> <select name="BeneficiaryBank" maxlength="20" tabindex="108"> <option value=""> </option> <option value="">Bank of trump</option> <option value="">Obama bank</option> </select> </p> <p> </p></td> <td> </td> <td> </td> <td colspan="2"> </td> </tr> <tr> <th><label for="Beneficiary Accountr" >*Beneficiary Account No (NUBAN):</label></th> <td><p> <input type="number" name="BeneficiaryAccount" value="" placeholder="N/A" maxlength="20" tabindex="116" maxlength="20" tabindex="114"/> </p> <p> </p></td></form> <tr> <th> <label for="Payment Reference" class="btn-group-lg"> Payment Reference:</label> </th> <td><input type="text" name="PaymentReference" value=""></td><br> </table> ><br> <!-- Trigger/Open The Modal --> <button type="button" id="myBtn" class="btn btn-info" data-toggle="modal" data-target="#myModal" >Proceed</button> THIS IS THE MODAL WINDOW <!-- The Modal --> <div id="myModal" class="modal"> <!-- Modal content --> <div class="modal-content"> <div class="modal-header"> <spal class="close1">×</spal> <h4 class="modal-title">Please enter your secure Transaction Code.</h4> </div> <div class="modal-body"> <label for="TransactionCode">*Transaction Code:</label> <input type="text" name="TransactionCode" value="" maxlength="40" size ="30"tabindex="107"> <p> For Transaction Code <a href="#">click here</a></p> </div> <div class="modal-footer"> <button type="button" id ="myBtn2"class="btn btn-info" data-toggle="modal" data-target="#myModal2">Proceed</button> </div> <!-- The Modal --> <div id="myModal2" class="modal"> <!-- Modal content --> <div class="modal-content"> <div class="modal-header"> <span class="close2">×</span> <h4 class="modal-title">Please enter your secure Tax verification code.</h4> </div> <div class="modal-body"> <label for="taxcode">*Tax Verification Code:</label> <input type="text" name="taxcode" value="" maxlength="40" size ="30"tabindex="107"> <p> For Tax Verification Code <a href="#">click here</a></p> </div> <div class="modal-footer"> <button type="button" id ="myBtn2"class="btn btn-info" data-toggle="modal" data-target="#myModal2">Proceed</button> </div> </div> </div> </div> </div> </div> THIS IS THE SCRIPT <script> // Get the modal var modal = document.getElementById('myModal'); var modal2 = document.getElementById('myModal2'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); var btn2 = document.getElementById("myBtn2"); // Get the <span> element that closes the modal var spal = document.getElementsByClassName("close1")[0]; var span = document.getElementsByClassName("close2")[0]; // When the user clicks the button, open the modal btn.onclick = function() { modal.style.display = "block"; } // When the user clicks the button, open the modal btn2.onclick = function() { modal2.style.display = "block"; } // When the user clicks on <span> (x), close the modal spal.onclick = function() { modal.style.display = "none"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal2.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "block"; } } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal2) { modal2.style.display = "block"; } } </script>
  2. concerning the issues, whenver i click on the the 2nd button before clicking on the 1st button it show the modal window but does not show the user input (2nd button): <button type="button" id="myBtn" name="myBtn" class="btn btn-info" data-toggle="modal" data-target="#myModal">Proceed</button> but when i click on the 1st submit button it reload the page but does not show the modal . if i decide to click on the 2nd button again after i have click on the 1st one, it show the user input in the modal (1st button): <input type="submit" name="myBtn" /> i only need one button but because of the probs i decided to use two buttton so i can get to the root of the problem. when i try to use only the first button it only reload the page, when i use the 2nd button it show the modal but doesnot display the user input......
  3. My answer is yes to all your questions those are the exact problem i am facing. I am trying to do it with some more JS. I dont know but i think this where i am having issues <form method="post" action=""> <input type="text" name="something" value="<?= isset($_POST['something']) ? htmlspecialchars($_POST['something']) : '' ?>" /> </form> <!-- Trigger/Open The Modal --> <button type="button" id="myBtn" name="myBtn" class="btn btn-info" data-toggle="modal" data-target="#myModal">Proceed</button> <!-- The Modal --> <div id="myModal" class="modal"> <!-- Modal content --> <div class="modal-content"> <span class="close">×</span> <p>Some text in the Modal..</p> <?php if(isset($_POST['myBtn'])) { echo 'You entered: ',"something"; } ?> </div> </div> <script> // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal btn.onclick = function() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "block"; } } </script> </div> </div></div>
  4. Yes is going to be popup div modal. After confirming their input and click on submit another modal will pop. Its an assignment and that is the way we are instructed to do it. kindly help me please. I Have been facing this challenge for over a month.
  5. The reason i wanted to show it in modal is to allow the user to confirm/verify. After verification the user then click the submit button in modal and a new modal window will pop up
  6. You were trying to eexplain something to me in your first reply......... but i really dont get the explanation
  7. The below code is not part of it, it was a mistake <input type="submit" name="myBtn" />
  8. i dont get you please am still new to php and javscript. kindly explain to me better or modify the code for me please
  9. <form method="post" action=""> <input type="text" name="something" value="<?= isset($_POST['something']) ? htmlspecialchars($_POST['something']) : '' ?>" /> <input type="submit" name="myBtn" /> </form> <!-- Trigger/Open The Modal --> <button type="button" id="myBtn" class="btn btn-info" data-toggle="modal" data-target="#myModal">Proceed</button> <!-- The Modal --> <div id="myModal" class="modal"> <!-- Modal content --> <div class="modal-content"> <span class="close">×</span> <p>Some text in the Modal..</p> <?php if(isset($_POST['myBtn'])) { echo 'You entered: ', htmlspecialchars($_POST['something']); } ?> </div> </div> <script> // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal btn.onclick = function() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "block"; } } </script> </div> </div></div>
  10. How do i change the code from mysql to mysqli or pdo?
  11. Hi am new to php and am facing some difficulty concerning the login.php. My register.php is inserting to the database but when i try to select it so i can login it keeps showing me the errmsg. These are the codes.. <?php ob_start(); session_start(); require_once 'dbconnect.php'; // it will never let you open index(login) page if session is set if ( isset($_SESSION['user'])!="" ) { header("Location: home.php"); exit; } $error = false; if( isset($_POST['btn-login']) ) { // prevent sql injections/ clear user invalid inputs $userlogin = trim($_POST['userlogin']); $userlogin = strip_tags($userlogin); $userlogin = htmlspecialchars($userlogin); $pass = trim($_POST['pass']); $pass = strip_tags($pass); $pass = htmlspecialchars($pass); // prevent sql injections / clear user invalid inputs if(empty($userlogin)){ $error = true; $userloginError = "Please enter your loginid."; } if(empty($pass)){ $error = true; $passError = "Please enter your password."; } // if there's no error, continue to login if (!$error) { $usepassword = hash('sha256', $pass); // password hashing using SHA256 $res=mysql_query("SELECT `id`, `loginid`, `firstname`, `middlename`, `lastname`, `phone`, `email`, `password`, `cpassword`, `answer` FROM icpl WHERE userlogin='$userlogin' AND usepassword='$usepassword'"); $row=mysql_fetch_array($res); $count = mysql_num_rows($res); // if uname/pass correct it returns must be 1 row if( $count == 1 && $row['password']==$usepassword && $row['loginid']==$userlogin ) { $_SESSION['user'] =true; $_SESSION['user'] = $row['loginid']; header("Location: home.php"); } else { $errMSG = "Incorrect Credentials, Try again..."; } } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Coding Cage - Login & Registration System</title> <link rel="stylesheet" href="login-registration-php-new/assets/css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" /> <style type="text/css"> #apDiv1 { position: absolute; width: 200px; height: 115px; z-index: 1; left: 236px; top: 139px; } #apDiv2 { position: absolute; width: 200px; height: 115px; z-index: 1; left: 501px; top: -17px; } .container #login-form form .col-md-12 .form-group #apDiv2 .form-group h2 { color: #F00; } </style> </head> <body> <div class="container"> <div id="login-form"> <form method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" autocomplete="off"> <div class="col-md-12"> <div class="form-group"> <div id="apDiv2"> <div class="form-group"> <h2 class="">Sign In.</h2> </div> <div class="form-group"> <div class="form-group"><span class="text-danger"><?php echo $passError; ?></span></div> <span class="text-danger"><?php echo $userloginError; ?></span> <hr /> <?php if ( isset($errMSG) ) { ?> </div> <div class="form-group"> <div class="alert alert-danger"> <span class="glyphicon glyphicon-info-sign"></span> <?php echo $errMSG; ?></div> </div> <?php } ?> <div class="form-group"> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> <input type="text" name="userlogin" class="form-control" placeholder="Your LoginId" value="<?php echo $userlogin; ?>" maxlength="40" /> </div> </div> <div class="form-group"> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span> <input type="password" name="pass" class="form-control" placeholder="Your Password" maxlength="15" /> </div> </div> <div class="form-group"> <hr /> </div> <div class="form-group"> <button type="submit" class="btn btn-block btn-primary" name="btn-login">Sign In</button> </div> <div class="form-group"> <hr /> </div> <div class="form-group"> <a href="../../register.php">Sign Up Here...</a></div> </div> <h2 class=""> </h2> </div> </div> </form> </div> </div> </body> </html> <?php ob_end_flush(); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.