Jump to content

Funce

Moderator
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Funce

  1. Nope, it's really bamboozling, but leaving the order as it is, and adding the ajax options will help.
  2. In addition, to fix the issue with the data capture, you need name attributes on all of your inputs.
  3. 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.
  4. I think the two might be linked. The append call may be surrounding the .ajax request.
  5. 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 })
  6. Has your FormData object been initialised as below? var formData = new FormData($("#student_info")[0]);
  7. 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 }); });
  8. 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.
  9. What do you expect it to show?
  10. What tutorial are you following? What code are you running? (Is the text white on a white background?)
  11. 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.
  12. 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.
  13. 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.
  14. Hi there, Can you give us the code that isn't working? Do you have an idea on where exactly its gone wrong?
  15. 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?
  16. 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.
  17. 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.
  18. 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.
  19. 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.
  20. 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
  21. 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.
  22. 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 }
  23. Usually if a font isn't displayed on a given device, it doesn't have that font installed. It may also be referred to as something else, which is why it's important to use fallback fonts. As an example, fallback fonts for "Times New Roman" is Times and Serif So you can define it in your style as follows .example-class { font-family: "Times New Roman", Times, serif; } Also, try using the forum's code block feature. It makes it easier for us to read your code.
  24. From my experience, <a> tags have their own styling that they apply after all inherited styles, but before any styles it has assigned to the element itself. This just means that if you want to style <a> tags, you need styles that directly apply to <a> tags. You'll need to add a style like this table.table.table-striped.table-condensed.table-bordered.table-hover a { /*Styles here */ } Or add a class to the <a> tag and style that.
  25. What browser are you using for this? I just tried Internet Explorer, and it seems to have the error you illustrated. Perhaps a different browser would suffice? I was testing on Chrome in my previous posts, and was unable to recreate the error on it.
×
×
  • Create New...