Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Funce

  1. There isn't very many specifics here. I wouldn't be able to advise exactly. The possibility of this will depend on how well documented the supplier api you wish to use.
  2. Yes indeed, checkboxes only send data when checked. Glad I could help.
  3. Name attributes on your inputs. That's the only way the data can be retrieved in the FormData. I can see one textarea has one 'title1' which is why you can probably see that one.
  4. Nope, it's really bamboozling, but leaving the order as it is, and adding the ajax options will help.
  5. In addition, to fix the issue with the data capture, you need name attributes on all of your inputs.
  6. Maybe the ajax request is preemptively modifying the formData object, I have no idea. But I do know that adding the ajax options fixes the append error.
  7. I think the two might be linked. The append call may be surrounding the .ajax request.
  8. Also you'll need to add some additional options to the ajax request. Sorry, I missed them before $.ajax({ type: "POST", // define the type of HTTP verb we want to use (POST for our form) url: "./_utilities/php/student_info.php", // the url where we want to POST data: formData, // our data object processData: false, contentType: false })
  9. Has your FormData object been initialised as below? var formData = new FormData($("#student_info")[0]);
  10. Hiya Roddy, Please view below, the data aggregation and subsequent form submission. $(".SignUpButton").click(function() { //Build the formData payload var formData = new FormData($("#student_info")[0]); var poData = $("#topic_info").serializeArray(); for (var i = 0; i < poData.length; i++) formData.append(poData[i].name, poData[i].value); //Now send it $.ajax({ type: "POST", // define the type of HTTP verb we want to use (POST for our form) url: "./_utilities/php/student_info.php", // the url where we want to POST data: formData // our data object }) .done(function(data) { //Redirect here? }) .fail(function() { //Error message if you'd like }); });
  11. Hi there Roddy, If you want to post two sets of data, you'll probably want to use an AJAX request. Stand by, I can also get you the grouping code for submission of two forms as well. Hang in there.
  12. What do you expect it to show?
  13. What tutorial are you following? What code are you running? (Is the text white on a white background?)
  14. So, uh, I did a bit of digging to look into this, and it seems that setItem stores a string, so getItem returns a string and a non-empty string is always truthy. Dang it. If you change the getItem code to the following var element = document.body; if (localStorage.getItem("changeMode") == "true") { //dark-mode is on element.classList.add("dark-mode"); } You should have a bit more luck with this.
  15. I should specify that the two sets of code should be separate, though I do notice an error in the code that I gave you (apologies for that) I'll do my best to clarify. So my changeMode function should still be accurate, just need to move the changeMode Loading This should be your program flow Page Load Load the value of changeMode Press Change Mode Button Toggle Class Save value of change mode And I'll amend my code to be correct. var element = document.body; if(localStorage.getItem("changeMode")) { //Note getItem rather than setItem //dark-mode is on element.classList.add("dark-mode"); } //If dark-mode isn't on, the natural state of the page //doesn't need to be changed. Now the code above needs to be run when the page loads, are you able to figure that part out? In addition, you can use the Forum's Code Block feature to post snippets of code so that they are readable. Check it out.
  16. Oh I see. Well for this you'll need two parts. You'll need the part which saves the state of the dark-mode. This will occur when you press the 'dark-mode' button. function changeMode() { var element = document.body; element.classList.toggle("dark-mode"); localStorage.setItem("changeMode", element.classList.contains("dark-mode"); } Then when the page loads, you'll need to retreive the dark-mode state and apply it. var element = document.body; if(localStorage.setItem("changeMode")) { //dark-mode is on element.classList.add("dark-mode"); } //If dark-mode isn't on, the natural state of the page //doesn't need to be changed. As an aside, I couldn't really stay on your website for more than about fifteen seconds, due to all the movement in the page giving me motion sickness. You may want to tone that down, probably on the backgrounds.
  17. Hi there, Can you give us the code that isn't working? Do you have an idea on where exactly its gone wrong?
  18. Funce

    Tkinter Formular

    Hi there, and welcome to the forums! The only issue I've run into with your code is that provider isn't defined. I can't be sure that's defined in mysql as I removed that module from the code. What are you trying to make happen, and what's actually happening in this code?
  19. Funce

    Slider height problem

    Can you shrink this example to use the carousel/slider only? Then you'll be able to paste the code into the forums directly.
  20. Hi there, the fix for this one will be to set your image to be .box .box-image img { max-width: 100%; display:block; /*New thing*/ } You won't find this very often from me, but I don't understand why this works. If someone could elaborate that would be good.
  21. Is the header overlapping the form? You may be able to get away with checking the z-index of the header vs the form and making sure the form is higher. But without the code you're working with, it's hard to say.
  22. Assuming that frm_order is a form, unless you've defined that elsewhere, you need to do $("#frm_order") to access it. There would be a syntax error preventing any further execution. Hence, nothing is done. The second function you want to run, just does the same thing as the first? Clicking a submit button inside a form, is just $("#frm_order").submit() with extra steps.
  23. Funce

    SQL Tryit Editor

    Trying it in Firefox yields a different result Error in SQL: Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'. I'd suggest clicking on "Report Error" at the bottom of the page I linked. That will alert the devs to fix it. Here it is again https://www.w3schools.com/sql/sql_ref_drop_table.asp
  24. Funce

    SQL Tryit Editor

    Huh, that's interesting. It seems that even using the example code in https://www.w3schools.com/sql/sql_ref_drop_table.asp is enough to error out.
  25. Instead of storing your image data in the database, I'd recommend storing it in the file system, and storing the path. Do you have a database that is doing this? Then you could try this <?php require("conexion.php"); //conectando a la base de datos $select = 'select * from peliculas'; $resultado = mysqli_query($miconexion, $select); while ($filas = mysqli_fetch_array($resultado)) { ?> <div> <input type="image" src="<?= $filas["ruta_imagen"]; ?>" onclick=""> </div> <?php } mysqli_free_result($resultado); ?> Alternatively if all your file names are like the following: imagenes/imagen1.jpg imagenes/imagen2.jpg imagenes/imagen3.jpg etc Then you can also try something like this (without a database. <?php for (var i = 1; i <= 3; i++) { ?> <input type="image" src="imagenes/imagen<?=i;?>.jpg" onclick=""> <?php }
  • Create New...