Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Your in luck! w3schools provide tutorials on theses very options i suggested.
  3. Today
  4. Dear all, I am working on an embedded Linux platform with Lighttpd and PHP-7.0. My goal is using some HTML button and sliders to write some values on a local file. For example, if I click on a HTML button, I want to create and write a text file located in /home/$USER/ To do that, I build some files HTML <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>AI-VISION</title> <style> </style> </head> <body> <form action="test1.php" method="POST"> <input type="submit" value="Open Script"> </form> </body> </html> PHP <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); exec("/bin/bash /var/www/html/test.sh"); ?> SHELL BASH #!/bin/bash cd /home/$USER/ touch testFile && echo "This is a test" > testFile So, when I launch the Shell Script like this: cd /var/www/html ./test.sh It works fine, and when I launch the PHP script like this: cd /var/www/html php test1.php It works also. My problem is when I want to launch it through the webpage...it doesn't works. I think because I have some wrong permissions, so I did this: sudo usermod -a -G www-data $USER sudo chgrp -R www-data /var/www/html sudo chmod -R g+w /var/www/html But no luck, I still doesn't work. Do you have an idea of the problem ? Thanks for your help and support. Regards,
  5. Hi Dsonesuk, Thanks for your directive, but I don't know how to do that. Could you please give me a guidance according Javascript/PHP to take the value of the slider, and write it to my local disk ? Thanks
  6. Hello, @Herodotus In your code, everything is right just check the path of the image whether your image file and code is under same folder. Else pass full url of image file like this : background-image: url("file://C:/Users/Admin/Desktop/Images/img2.jpeg"); I hope above information will be useful for you. Thank you.
  7. refer this: <iframe width=”560″ height=”315″ src=” https://www.youtube.com/embed/[Video ID]I?&autoplay=1″ frameborder=”0″ allowfullscreen></iframe> https://www.4kdownload.com/howto/how-to-autoplay-embedded-youtube-videos
  8. I have a website http://www.siftradingsystems.com/ I would like to devote one page to some comments which would come to the page in the form of a small text file uploaded from my desktop. The page would be scrollable and each added comment would appear in its own window. I simply want the web page to grab the uploaded text files and display them sequentially without my having to do anything other than create the original text file and put it where it can be uploaded. Can someone please point me in the right direction. Thanks for any advice.
  9. Yesterday
  10. You can add some CSS to hide the element when printing using a media query: https://www.w3schools.com/cssref/tryit.asp?filename=trycss3_media
  11. How do we prevent Buttons from printing when printing a page? I thought it should something like putting class='noprint' in the button code but that doesn't work. Tks
  12. Last week
  13. Sorted it! Changed submit from <input type="submit"> to <input type="button" value="Click me" onclick="msg()"> https://www.w3schools.com/tags/att_input_type_button.asp https://www.w3schools.com/css/tryit.asp?filename=trycss_form_button Works anyway but I still hate CSS😝.
  14. This is awesome. Thanks as always. I will explore this and will get back to you if I have any questions.
  15. Because PHP runs on the server-side, allowing arbitrary users to run any PHP on their server would make it very easy for hackers to take over the website. I would suggest downloading a local server such as XAMPP to run PHP on your own computer.
  16. Unfortunately, the staff rarely visits the forums. As far as taking length calls out of the loop, it's a negligible performance impact in 99% of situations. If you were writing a heavy time-critical application this would be one of the optimizations you could do to improve it if you find that it's running slow.
  17. Begin writing software, if you run into a problem you can't solve then search online for an answer or ask about it.
  18. It's not the object that's the problem, it's JSON.stringify().
  19. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Document Title</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content=""> <style> *{box-sizing: border-box;} </style> </head> <body> <form> <input type="number" id="entervalue" value="0"> &plus; <input type="text" id="percentage" value="10">% <input type="text" id="calculate" value="0" disable> </form> <script> var x =document.getElementById("entervalue"); var y=document.getElementById("percentage"); window.onload=function(){ x.onkeyup=function(){ updatecalc(); } y.onkeyup=function(){ updatecalc(); } } function updatecalc() { var z=document.getElementById("calculate"); z.value=((x.value / 100 * parseInt(y.value))+ parseInt(x.value)); if(x.value=="" || y.value==""){ z.value=z.defaultValue; } } </script> </body> </html>
  20. I have been searching all over but could not find a thing specific. Can you help me with some code?
  21. Hello, I am very new to javascript and jquery. I like to have a text field where I can enter a dollar value and then system should generate 10% and display the number as it is calculating on my website. I am not sure how to do that and what language to use. Sample is on this page Cash reward section. Thank you!
  22. Thank you! I will play with that tonight.
  23. How can I add a date to an object without it changing due to the timezone? Example: var mydate1 = new Date('2019-12-10 00:00:00'); var myobject1 = {"mydate": mydate1}; alert(mydate1 + " - " + JSON.stringify(myobject1)); Result is: Tue Jan 01 2019 00:00:00 GMT+0100 (Ora standard dell’Europa centrale) - {"mydate":"2018-12-31T23:00:00.000Z"} Thank you.
  24. Hi there, I am new to all this so please bear with me! I am hoping it is something obvious missing in the code. I am using 2 jquery date pickers in one page, and hoping so that when a date is selected in the first, it disables that selected date in the second calendar. Here's what I have: <form onSubmit="return UpdateDeliveryOptions()"> <input class="input" id="disableDate" value="Date to disable"> <input type="submit" class="button is-medium is-primary" value="Save"> </form> <div id="customerCalendar"></div> jQuery(function($) { let disabledDates = []; function UpdateDeliveryOptions() { dateValue = document.getElementById('disableDate').value disabledDates.push(dateValue) return false }; $("#disableDate").datepicker({ }); $("#customerCalendar").datetimepicker({ beforeShowDay: function(date) { let string = jQuery.datepicker.formatDate('yy-mm-dd', date); return [disabledDates.indexOf(string) == -1] }, timeFormat: 'HH' }); }); I have no backend to save to, so I read I needed to add 'return' the where the function was called, and 'return false' to the function to stop the page refreshing and losing everything. When I hit 'save' there is a flash of an error message in console, but is too quick to read what it says. All I can see is it isn't working. Does this sort of function need to convert the array to JSON to work? Or is there a way to make this work as it is? Help appreciated, thanks in advance.
  25. https://www.w3schools.com/code/tryit.asp?filename=G0V6RXVDG3PU
  26. Hi @vitalnet, I have tried to code as per your requirement. Kindly check the same. Hope it will work for you. <html lang="en"> <head> <title>Bootstrap 4 Tooltip Persists, Looks Terrible</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h3>Bootstrap 4 Tooltip Persists, Looks Terrible</h3> <br> "Other button disabled" scenario works fine. <br> First, hover over buttons. Look at tooltips while hovering. <br> Then, click button A to disable button B. Works fine: <br> - Button B is disabled, and no tooltip. <br> - Tooltip still works correctly on button A. <br> <br> <button type="button" id="button_a" class="btn btn-primary" data-toggle="tooltip" data-trigger="hover" title="Disables Button B" onclick='change_button ("button_b", true);'> Button A </button> <button type="button" id="button_b" class="btn btn-primary" data-toggle="tooltip" data-trigger="hover" title="Disabled by Button A"> Button B </button> <br> <br> <hr> <br> "Same button disabled" scenario fails. <br> First, hover over Button C. Look at the tooltip. <br> Then, click button C to disable button C. Messes up: <br> - Button C is disabled, so that part is OK. <br> - But Button C tooltip persists, looks terrible. <br> <br> <button type="button" id="button_c" class="btn btn-primary" data-toggle="tooltip" data-trigger="hover" title="Disables Button C" onclick='change_button ("button_c", true);'> Button C </button> <button type="button" id="button_d" class="btn btn-primary" data-toggle="tooltip" data-trigger="hover" title="Enables Button C" onclick='change_button ("button_c", false);'> Button D </button> <br> <br> <hr> <br> So if a button is disabled while the cursor is hovering over it, the tooltip persists. <strong> Could you please explain how to make tooltip go away when Button C is disabled? </strong> I would prefer if tooltip went away when Button C disabled, since that is default behavior of bootstrap disabled buttons. And disabled button may later get enabled again, so I do not want to delete title attribute. Basically I want bootstrap to behave the same way as when Button B is disabled. I have looked around and cannot find how to fix this problem, and have tried various things, with no success. There are real instances where a button carries out an action, and then the button needs to be disabled, so I appreciate the help. Thanks </div> <script> $(document).ready(function () { $('[data-toggle="tooltip"]').tooltip(); }); function change_button(button_id, bool_val) { if (button_id === 'button_c') { $('[data-toggle="tooltip"]').tooltip('hide'); } var button_obj = document.getElementById(button_id); button_obj.disabled = bool_val; } </script> </body> </html>
  1. Load more activity
×
×
  • Create New...