Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sigmahokies

  • Rank

Recent Profile Visitors

3,590 profile views
  1. Hi everyone, I'm wondering about Javascript and PHP allow to using same keyword with different reason, like using keyword word twice in html line. For example, I'm using keyword "name" in Javascript for count in adjust number, now, I'm trying to use keyword "name" for other reason, like undo all checked. Can use keywords more than one time? or cannot be done? Thanks, Sigmahokies
  2. Sigh...All right, you are not helpful. I will do other forum, I hope someone can help me.
  3. I'm still not get it...Maybe that "this" keyword is not useful. I'm not sure I understand, I thought "this" is good for pass variable to other class like other page.
  4. I'm not sure I get it about your last reply. I checked around about "this" keyword in Javascript...it's not clear to me.
  5. So, do i have to use class? class is allowed to have multiply...
  6. Hi everyone, I'm still learning, but getting deeper now. I'm trying to use JavaScript and PHP in one page in website. I'm trying to make a switch video source on html by click on button. I believe I'm doing right in PHP, but Javascript seem something is missing. I don't understand how it gone work...it said undefined. <!doctype html> <html> <head> <link href="css/grammar.css" rel="stylesheet" type="text/css"> <link rel="icon" href="images/sigma.png"> <script type="text/javascript" src="js/checkbox.js"></script> <script> function clickvideo() { let path = document.getElementById("video1").button; document.getElementById("display").innerHTML = "<video width='450' controls style='border-radius: 5px;' height='240' type='mp4'>" + "<source src='UPLOADS/Breakfast/" + path + "'></video>"; } </script> </head> <body> <table class="table"> <tr><td><video width="450" controls style="border-radius: 5px;"><source src="video/Ha_Demo.mp4"></video></td></tr> <tr><td> <div id='display'><video width='450' controls style='border-radius: 5px;'><source src="UPLOADS/Breakfast/hello.mp4"></video></div></td></tr> <tr><td> <?php $video = opendir("UPLOADS/Breakfast/"); while(($listvideo = readdir($video)) !== FALSE) { if(preg_match("/^[^\.].*$/", $listvideo)) { echo "<button id='video1' onclick='clickvideo()'>".$listvideo."</button>&nbsp;"; } } ?> </td></tr> </body> </html>
  7. So, do I have to find source, then download it, then put in path to connect to this script?
  8. Hello everyone, I'm trying to create a RSA encryption, but seem it is not function correctly. Is Javascript know RSA? like, let rsa = new RSA(); do I have to download from github? here my code: let rsa = new RSA(); let prime = ["2", "3", "5", "7", "11", "13"] //<-- Prime number let random = prime[Math.floor(Math.random() * prime.length)]; let text = document.getElementById("readed"); document.getElementById("en").innerHTML = rsa.encrypt(random, text); Seem console log show it is not function.
  9. Never mind, i found a way to post, Javascript and PHP can use one keyword, but work in separate.
  10. Hi Justsomeguy, Ok here my code, I replaced array ([ ]) to nothing in PHP, so PHP should able to get data from this name. <tr><td>Go/Walk-To/From</td> <td><label for="box"><input class="single-count" type="checkbox" id="box" name="chkboxGrp0[]" value="1"></label></td> <td class="vert-middle">0</td></tr> <tr><td>Bring-Stack-Comic</td> <td><input class="single-count" type="checkbox" name="chkboxGrp1[]" value="1"></td> <td class="vert-middle">0</td></tr> <tr><td>Pick-up</td></tr> In JavaScript: var inputNameArray = []; for (var j = 0; j < chkbox.length; j++) { var chkBoxNameStripSqrBraces = chkbox[j].name.replace('[]', ''); <---- if (inputNameArray.indexOf(chkBoxNameStripSqrBraces) === -1 && chkbox[j].checked === true) { chkboxTotal[parseInt(chkBoxNameStripSqrBraces.replace('chkboxGrp', ''))].innerHTML = "1"; inputNameArray.push(chkBoxNameStripSqrBraces); } In PHP: if (isset($_POST['save'])) { $name01 = $_POST['chkboxGrp0[]']; $name01 = $_POST['chkboxGrp1[]']; } Look at arrow in JavaScript, please then goes on save in database... As you can see Javascript use "name", but I need "name" in php to get data from form in HTML, but seem it won't work because of conflict. I'm sorry if you don't understand, I'm ASL user, not english. if still not understand, i will display all whole code.
  11. Hi everyone, I want to make clear again. I am trying to get data from "name" by PHP in HTML, but problem is "name" is used up by Javascript, but I need "name" for PHP's $_POST to get data from input from html, but can I use this "name" by JavaScript and PHP in same time? I need to get data from that word to post in database, but I think I'm stuck now...Anyone can tell me what is alternative keyword to get data from "name" in HTML? If you don't understand what I said, I will display and show you Thanks, Gary
  12. Hi everyone, is it possible to collect data such as checkbox and radio inside iframe when push button outside of iframe? or require to method of post inside iframe?
  13. I used session storage, seem it doesn't work. I use localstorage, seem it works a little, but stayed checked on checkbox has not work. here code I get from other website, but seem function is not right <script> function onClickBox() { let checked = $("#box").is(":checked"); localStorage.setItem("checked", checked); $("#msg").text("Checkbox is checked: " + $("#box").is(":checked")); } function onReady() { $("#msg").text("Loaded."); let checked = "true" === localStorage.getItem("checked"); $("msg").prop('checked', checked); $("#box").click(onClickBox); } $(document).ready(onReady); </script> <form> <div id="msg"></div> <table> <tr><th colspan="3">Spatial Verbs</th></tr> <tr><td>Go/Walk-To/From</td> <td><input class="single-count" type="checkbox" id="box" name="chkboxGrp0[]" value="1"></td> <td class="vert-middle">0</td></tr>
  14. Does that mean i have to use PHP as well?
  15. Hi everyone, I'm trying to create the look like "paginate data page", but it is not. I set up the file to insert in website by iframe, but I need to find a way to make clicked data like click the checkbox, then click on next, go to next file in iframe, then come back, stay checked in checkbox. Do you understand what I mean? I'm not fluent in English, my prime is American Sign Language.
  • Create New...