Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Get Checkbox Data error

    <?php $stove=""; if(isset($_POST['stove'])){ $stove=$_POST['stove']; }
  3. Yesterday
  4. Get Checkbox Data error

    In my form file I have [<input type=\"checkbox\" name=\"stove\" id=\"stove\" value=\"y\">] I use [method=\"POST\"] on Submit. In my next file I have [$stove=$_POST['stove'];] which works fine if the box was checked but if the box was not checked, I get error "Notice: Undefined index: stove in...." How can I test if the checkbox has been checked? Tks
  5. Slideshow - No initial image

    You're getting a Javascript error on that page, it might be caused by including and running that Javascript code before the elements on the page are ready.
  6. Slideshow - No initial image

    I used the code from this location.... https://www.w3schools.com/howto/howto_js_slideshow.asp And got it to work ok, for my purposes (with just a few changes) except the initial image doesn't show up. Clicking a dot will make it start, but how do I get it to show the first image automatically. See: https://www.audioanalogy.ca/studiotour.htm to see only the dots, but no start image. I hope someone can help narrow down the glitch. Thanks
  7. It would be good if the javascript used in certain W3 CSS components was unified in a .js file. And that the options that these components could have, currently very limited, could be passed as parameters to these functions, achieving many more versatility and power.
  8. Displaying Table Results on a page

    In general, you send a select SQL query to get the data you want, and you loop through the results to display each result however you'd like. WordPress should already have a database object you can use to interact with the database.
  9. Keep a form open to enter data

    You need to use event handlers. You can use a key event on the field itself, or a click event on the button or whatever, but that event handler should get the form data and set it in localstorage.
  10. Matomo: async, defer, and insertBefore()

    It's not magic, like all the rest of jQuery it's just a wrapper for existing vanilla Javascript. jQuery does not add any functionality, all it does it make certain things easier to use. The only scripting language all modern browsers understand is Javascript, so anything like jQuery is ultimately written in and uses vanilla Javascript. For the ready function, it's just a wrapper for the document.load event. More specifically, and recently, it probably just runs document.addEventListener if that's available. In terms of what it does, you just declare and pass a function to it which will get executed when the event happens. It's not about "permitting" things to run, things happen in a well-defined order, and as far as I know the event handlers do get executed in the order in which they're added but I believe they also get executed asynchronously. That's why I said to leave jQuery out of the discussion - if you want to understand what it does, you only need to understand the underlying Javascript concepts on which jQuery is built. If you understand that then you can review the jQuery source code to see how jQuery specifically uses the built-in functionality. The source code for that is here: https://github.com/jquery/jquery/blob/master/src/core/ready.js Lines 71 through 84 set up the actual DOM event to execute jQuery's own event handler, which is the completed function, which calls the internal ready function, which runs each handler on line 54.
  11. Validating Custom Form in Admin Panel

    There's some information here: https://codex.wordpress.org/Creating_Options_Pages https://codex.wordpress.org/Writing_a_Plugin
  12. Keep a form open to enter data

    I hope there is a simple solution to this. I want to use localStorage to remember a user, but if it's not there I want to open a form so the user can enter the info in the input box and press Submit. Then I would put that info into the localStorage for next time. I can get the form to open and display fine, but the code just continues to execute after I open the form ( display set to "block"). How can I get the code to stop and wait for the input to come in before continuing with the next line of code? I have looked at the <dialog> tag with '.showmodal' which would work I guess, but it says it is not supported in Internet Explorer or FireFox; I want it to work in all browsers. I have tried a while loop to wait until the 'submit' button is pushed, but the whole thing bombs out when I put it in and the modal form doesn't even show. If I assign a value to the input , and insert the line "userID = document.getElementById("enterUserID").value;" just b/4 the return statement, I get the value I assigned. I appreciate any help explaining it to me.... I have included my code if it helps. <!DOCTYPE html> <html> <head> <title>Schenectady Kettles</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- <link --> <style> #logInModal {display:none;z-index:3;width:80%;height:200px;margin:auto; color:purple;background-color:lemonchiffon;text-align:center; font-size:8vw;font-weight:bold;} </style> </head> <body> <h3>Testing for Log In</h3> <div> <button id="logInBtn" type="button" onclick="logInClicked()">Log In</button><br> </div> <!-- Log In Modal --> <div id="logInModal"> <div> Enter User ID<br> <input type="text" id="enterUserID" placeholder="User ID" autofocus> <!-- Check input !! --> <button type="button" id="getIDBtn">Submit</button> </div> </div> <p id="demo"></p> <script> function logInClicked() { var uID = "hello"; if (typeof(Storage) !== "undefined") { if (localStorage.userID) { uID = localStorage.userID; } else { uID = getUserID(); document.getElementById("demo").innerHTML = uID; } } } function getUserID() { var userID = "123"; document.getElementById("logInModal").style.display = "block"; document.getElementById("getIDBtn").onclick = function() {userID = document.getElementById("enterUserID").value;}; return userID; } </script> </body> </html>
  13. Matomo: async, defer, and insertBefore()

    They may be read and executed, but a executed code may not completely finish before other code is executed. Unless you specifically create the code to run after the previous is completed. The jQuery ready( ) function acts as a onload event itself and is mainly used for presetting, manipulation of elements, and adding events to specific elements after the pages html has been fully rendered.
  14. Matomo: async, defer, and insertBefore()

    JSG: But, you have set aside the very thing that I was trying to understand -- the jQuery ready( ) function. If I have understood this function correctly, it allows the Javascript contained within the function to be read as the rest of the page is being downloaded, but does not permit what is read to be executed until the rest of the page has been completed. My question, then: does the jQuery ready() function also insure that the Javascript thus read and loaded execute in the order that it is entered into the ready function? Roddy
  15. Hi I have created a WordPress plugin located in the Admin panel that contains a custom form. How would I go about adding the Javascript validation here?
  16. Displaying Table Results on a page

    HI In WordPress, I have created a simple plugin that allows the logged in user to: - Add a Tender - Update a Tender - Delete a Tender Now I need to be able to display a list of all the tenders to our visitors (in table format). I am new to this and am not sure how to accomplish this task. Could someone please point me in the right direction? Much appreciated.
  17. Last week
  18. Modals with combo boxes

    You have missed closing div's for second modal, the btn1 still refers to first class 'close' found using index of 0, the 'bin' variable which has onclick event in second modal code, should be 'bin1'. You also need to reduce number of window.onclick events to 1, and add 'else if' condition to check for modal1 target event.
  19. Modals with combo boxes

    Ok I have 2 types of files I want people to be able to get. Article and Calendar. The differences are 1) the file names are a bit different - Year month Article.ext and Calendar month year.ext and 2) the extensions are different - doc for articles, docx for calendar, htm for article, html for calendar. There's a bunch of files so I'd really not have to go changing the file names. Here's the code I have so far. <style> body {font-family: Arial, Helvetica, sans-serif;} /* The Modal (background) */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ padding-top: 100px; /* Location of the box */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ } /* Modal Content */ .modal-content { background-color: #fefefe; margin: auto; padding: 20px; border: 1px solid #888; width: 80%; } /* The Close Button */ .close { color: #aaaaaa; float: right; font-size: 28px; font-weight: bold; } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; } </style> </head> <body> <h2>Please Select Star or Calendar.</h2> <!-- Trigger/Open The Modal --> <button id="myBtn">Monthly Star</button> <!-- The Modal --> <div id="myModal" class="modal"> <!-- Modal content --> <div class="modal-content"> <span class="close">&times;</span> <form> Select the year: <select id="mySelect"> <option>2018</option> <option>2017</option> <option>2016</option> <option>2015</option> </select> <br /> Select the month: <select id="mySelect1"> <option>January</option> <option>February</option> <option>March</option> <option>April</option> <option>May</option> <option>June</option> <option>July</option> <option>August</option> <option>September</option> <option>October</option> <option>November</option> <option>December</option> </select> <br /> Select PDF, Word or Webpage: <select id="mySelect3"> <option>pdf</option> <option>doc</option> <option>htm</option> </select> <br><br> <input type="button" onclick="myFunction()" value="Click Me!"> <br /> </form> <a id="myLink" href="http://www.bethlehemvinton.org/Star/April 2017 Bethlehem Star.pdf">Microsoft</a> <script> function myFunction() { var obj = document.getElementById("mySelect"); var obj1 = document.getElementById("mySelect1"); var obj3 = document.getElementById("mySelect3"); document.getElementById("myLink").innerHTML = "New Link"; document.getElementById("myLink").href = "http://www.bethlehemvinton.org/Star/" + obj1.options[obj1.selectedIndex].text + " " + obj.options[obj.selectedIndex].text + " Bethlehem Star." + obj3.options[obj3.selectedIndex].text; document.getElementById("myLink").target = "_blank"; } </script> </div> </div> <!-- Trigger/Open The Modal --> <button id="myBtn1">Monthly Calendar</button> <!-- The Modal --> <div id="myModal1" class="modal"> <!-- Modal content --> <div class="modal-content"> <span class="close">&times;</span> <form> Select the year: <select id="mySelectC"> <option>2018</option> <option>2017</option> <option>2016</option> <option>2015</option> </select> <br /> Select the month: <select id="mySelectC1"> <option>January</option> <option>February</option> <option>March</option> <option>April</option> <option>May</option> <option>June</option> <option>July</option> <option>August</option> <option>September</option> <option>October</option> <option>November</option> <option>December</option> </select> <br /> Select PDF, Word or Webpage: <select id="mySelectC3"> <option>pdf</option> <option>docx</option> <option>htm</option> </select> <br><br> <input type="button" onclick="myFunctionC()" value="Click Me!"> <br /> </form> <a id="myLinkC" href="http://www.bethlehemvinton.org/Star/April 2017 Bethlehem Star.pdf">Microsoft</a> <script> function myFunctionC() { var objC = document.getElementById("mySelectC"); var objC1 = document.getElementById("mySelectC1"); var objC3 = document.getElementById("mySelectC3"); document.getElementById("myLinkC").innerHTML = "New Link"; document.getElementById("myLinkC").href = "http://www.bethlehemvinton.org/Star/Calendar for " + objC1.options[obj1.selectedIndex].text + " " + objC3.options[obj3.selectedIndex].text; document.getElementById("myLinkC").target = "_blank"; } // 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 = "none"; } } // Get the modal var modal1 = document.getElementById('myModal1'); // Get the button that opens the modal var btn1 = document.getElementById("myBtn1"); // Get the <span> element that closes the modal var span1 = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal btn.onclick = function() { modal1.style.display = "block"; } // When the user clicks on <span> (x), close the modal span1.onclick = function() { modal1.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal1) { modal1.style.display = "none"; } } </script> </body> If I do just 1 modal (the first one) it works fine. But when I add the 2nd it breaks so I'm assuming I've got 2 variables somewhere with the same name. 1) is this the easiest way to handle this? 2) I'd rather not have the link "Current..." showing but if I delete it then I can't make it work. I know I could probably do some scripting to create it on button click but ... well, sad to say I'm running out of time to get this done. Any help would be appreciated.
  20. Populating link with combo box values

    Thanks. It doesn't matter when it changes as long it's before populating the link. I've decided to try a different approach as the file names are different for Calendar and Article beyond the extension. So I was thinking that I could do 2 modals. 1 for article and 1 for calendar. but they're not working. I'm starting a different topic for that.
  21. Thanks for your help with this dsoneuk. At this point in time it is the only option. It makes sense what you are saying, and can see how this is a less-than ideal scenario. I will continue to explore options...
  22. CSS Required Field X Not Displaying Properly

    Try given it overflow: visible; or increase padding so is shows completely within the container.
  23. As far as the parent knows it has no content, because using position: absolute for child element takes it out of the flow from other elements. They will collapse, or attempt to fill the space left by these elements. The parent has no height and now no width because you are using float, which causes the element to shrink to content which as stated above does not exist. So all child element are moved now to the right, moving content from just inside the parent right edge outwards beyond the right edge. The child elements will overlap each other as well. ARE you sure you don't have an option? you see what you have to consider and issue you have to endure using position: absolute.
  24. Hi there, I have a scenario where I have no option but to absolute position some elements within a div. So I set the parent to position relative, the children absolute, job done. But if I float the parent container to the right, it jumps outside its wrapper. Is there a way to stop this happening? .wrapper{} .parent{position: relative; float: right;} .child{position:absolute;} <div class="wrapper"> <div class="parent"> <div class="child"></div> <div class="child"></div> <div class="child"></div> </div> </div> Thanks
  25. Hi I have created a Contact 7 Form and added some custom css as shown below. When I click the Sign-Up button and don't enter any data, the red box displaying the error X is being cut off. I thought it might have been my border, so I removed that and tested and the issue persists. How do I resolve this? div#wpcf7-f3791-p3734-o1 { border-radius: 25px; border: 2px dashed #0c6bb5; padding: 20px; }
  26. Populating link with combo box values

    Depends when you want it to change? On selection of 'calendar' Or on button click. On selection, requires you add onchange event to mySelect2 element, then check value, if true go to mySelect3 value/text directly using index for option element OR a 'for' loop, looping through each option then change when value/text matches. This option means the user will see the text/value of 'docx' for selection. On button click, the text/value of mySelect2 element is checked, if equals 'calendar', the value/text of mySelect3 is changed, the user will not see change take place. Note: You should avoid spaces in file names, as this can be problematic, I suggest you use hyphens '-', this is still readable by SEO. So not a case of simply saying it!
  27. Php.ini file?

    Ah I see, The host I use, has a plan for £50 for a year or something. I use a basic £11.39p hosting per month, only when I can, so I have to cancel if I don't have that amount. So this certificate authentication isn't really cheap, it is separate from a package. The free host I use is ad based, and just for the testing, has no real features, sub domains, but that is it, free forum packages and all that, but pretty pointless in learning php 7/mysql. Obviously I'm trying to create an account registration site, so something really basic like I've stated in the previous posts, sadly I can't get anywhere with this. The whole certificate cost is out of the question, I can only just try and make the site work. I'm stuck with that.
  28. Php.ini file?

    There are three main types of SSL and depending on type of website site you plan on having, determines the type of SSL you should use. See the bottom of this host certificate page on types and what they are used for. https://www.1and1.co.uk/ssl-certificate
  1. Load more activity
×