Jump to content

Q695

Members
  • Posts

    783
  • Joined

  • Last visited

Everything posted by Q695

  1. Why are you doing a drop down menu, and not a range slider with a javascript value reader?
  2. I'll have to try figuring it out first.
  3. Here is the whole code, which some stuff seems to break on when I move it from my testdev page: <script type='text/javascript'> $(function () { $('#btn1$i').click(function () { alert('open'); }); $('#save$i').click(function () { alert('submit'); var form = $('#myForm').get(0), fd = new FormData(form), xhr = new XMLHttpRequest(); xhr.open('POST', '/submit.php', true); xhr.onload = function () { console.log(xhr.responseText); $('#myModal$i').modal('hide'); }; xhr.send(fd); }); }); </script> <!-- Button trigger modal --> <br> <button type='button' class='btn btn-primary btn-lg' data-toggle='modal' data-target='#myModal$i' id='btn1$i'> Launch demo modal </button> <!-- Modal --> <div class='modal fade' id='myModal$i' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'> <div class='modal-dialog'> <div class='modal-content'> <div class='modal-header'> <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button> <h4 class='modal-title' id='myModalLabel'>Modal title</h4> </div> <div class='modal-body'> <form id='myForm'> <input name='user' type='text' value='Bob' /> <input name='percent' type='range' min='0' max='100' value='50' /> </form> </div> <div class='modal-footer'> <button type='button' class='btn btn-default' data-dismiss='modal'>Close</button> <button type='button' class='btn btn-primary' id='save$i'>Save changes</button> </div> </div> </div> </div>
  4. onchange then it gets the value would work the same way.
  5. Issues I'm having: scrapping the data on close automatically closing modal on submission The source libraries: <script src='//code.jquery.com/jquery-latest.min.js'></script> <script src='//code.jquery.com/jquery-migrate-1.2.1.min.js'></script> <script type='text/javascript' src='../other/scripts.js'></script> <script src='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js'></script> <link href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css' rel='stylesheet'> The code: <script type='text/javascript'> $(function () { $('#btn1$i').click(function () { alert('open'); }); $('#save$i').click(function () { alert('submit'); var form = $('#myForm$i').get(0), fd = new FormData(form), xhr = new XMLHttpRequest(); xhr.open('POST', '$post_to', true); xhr.onload = function () { console.log(xhr.responseText); $('#myModal$i').modal('hide'); alert('success'); }; xhr.send(fd); }); }); </script> possibly useful: I'm plugging $variable_name in with while loops.
  6. This should help: http://www.cinemahaven.com/webmaster-tutorial-jquery-ajax-php-tutorial-swap-out-page-content-on-your-website-using-php-video_06fda13e5.html
  7. The basic easy answer to set a value to a variable is: $item=$row['item']
  8. I decided to do it another way.
  9. Starting with: http://jsfiddle.net/qq441hux/ How do I modal the form to submit the data then close after triggering a " javascript:swapContent(\"help\" " to be ran? I've been baffled with this for days, and will be running jquery to populate the specific page.
  10. I'm not sure where to exactly begin with this query, but here's the objectives: Column A values: 3, 5, 7, 9, 21 Column B value: 2 Column User: $id Perform an if on each separate column A while ran in a batch process to speed up the query
  11. Walk away for a while, then come back, and now it works somehow
  12. ID as always is normally user id. it returns: Inserted rows: 1
  13. $news='news'; $sql_news = "INSERT INTO `rise`.`news` ( `user` , `message` ) VALUES ( :id, :news );"; $q_news = $conn->prepare($sql_news); $q_news -> execute(array(':id'=>$id, ':news'=>$news)); print_r($q_news); echo $q_news->rowCount(); Why does it echo 1 instead of 2 when everything else on the page is turned off for processing, and it's the last thing on the page? Why do 2 inserts happen?
  14. I'm trying to build a 3d table map of what you can see from where you are on the map of elements assigned to their individual <td> (the shell for every terrain square). I'm trying to make the page a lot faster than looping per row/column. Each data "byte" will be slower to look up individually then every bit contained in a "kilobyte" having its own reference on the database somewhere in no particular order.
  15. So rendering the items into a database object doesn't automatically make the page run quicker, if you're dumping the buffered data into a database as well as dumping it to the screen? The rendered item is essentially turning 25 pulls into 1 pull from the database. The rendering is turning page small chunks into fewer bigger page chunks thus you need 1 instead of 25 looked up. I'm using one database (small chunks) to populate another database (big chunks) to make the pages run quicker.
  16. Un-rendered: the object has yet to be built by the server from individual pulls. Rendered:you can do one pull, and less calculations to write something out as it's stored in the database as an object. Why do they seem to take the same amount of time?
  17. I'm sorry, I don't speak that language. I asked the guy who spoke at the apps at the speed of thought meetup in the MPLS area, and he said I was doing the right thing to run faster.
  18. The answer is better than the Nuclear answer, thanks.
  19. example: pulling a 5x5 array of data from a database time differences: components (unbuilt):13400101661682 elements (built):13817119598389 How I'm stealing the elements from the PHP code: ob_start(); ... ob_end_clean();
  20. I mean when the cookie expires it asks you to relogin in an in page html alert. How are those created?
  21. Does anyone know what the source code for the PHP MyAdmin login prompt (the pop out box) looks like?
  22. What's the linkup code for the jquery script, because I'd rather have it run as an auto update? You will save me many more headaches now that I can see what I'm doing with the DB stuff, but will need to rewrite everything else around it now. Can you post the table creation SQL, so I can see what your chat table looks like?
  23. I don't want to use AI, or a primary key to sort the data, as it could create some problems if the items are visited out of order, but I want to sort it always based upon a single element for speed. I'm creating a table that will be populated (built), when it's corresponding entry doesn't exist, how do I get it sorted out if someone visits 2, then 7 before they visit 5 to read what's there? It's not a 2d number line, but a 3d number grid.
  24. should've dug deeper than the top 3 XD
  25. Is that the same one the PHP engine uses when reporting errors to the user?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.