Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. loop input for each string

    When you click submit button, the first thing it should do to prevent duplication of created inputs IS remove any existing created inputs that may exist already, using jquery each loop again looking for attribute 'name' whose value begins with 'txtbox'. Example for selector is here https://api.jquery.com/attribute-equals-selector/ Here describes characters you can use to filter out specific inputs https://www.w3schools.com/css/css_attribute_selectors.asp Then use remove() to remove these elements that match https://api.jquery.com/remove/
  3. loop input for each string

    ok thanks, I don't understand
  4. loop input for each string

    You don't need join, you can just use the parameter variable from function directly. You need to clear any of these created inputs first before creating new inputs, ignoring the user input text box, either by class name or name attribute that begins with specific string name.
  5. loop input for each string

    I change the join += valeur + "<br>" join = valeur and now it's go well, but the problem now is that when you click two or more times on the submits, the inputs are multiplied so that I want it remains the same even if you always click on, do you know how we do for that?
  6. touchstart and click on refresh only

    Any Javascript errors will be on the console. You can also add some console.log statements in that code to have it print out what it's doing and verify.
  7. Date time not working...

    You have to realize that when you tell it Sunday, it's going to get the next Sunday. If you run that at Monday at 1am, and tell it you want Sunday, it's going to get the next Sunday, not yesterday. You may need more logic to figure out what you want. For example, get the current day of the week first and go from there. If the current day is Sunday, and it's after 9:55, or the current day is Monday and it's before 1:30, then do whatever you want to happen.
  8. Two Forms, Two Actions, Same Page

    I don't think your question is worded correctly, $_POST is available on every request but your browser will only send one request at a time. Meaning you can only submit one form at a time. Anything that you want to be submitted all needs to be in the form. Of course, you can use Javascript to add or remove form elements if you want to build an interface like that. But each request to the server is only 1 request, you don't send multiple requests at the same time other than if you're using ajax to send a bunch of requests, but even so that's not the best idea. If you find yourself sending multiple requests in a short period you probably need a more efficient design, requests have overhead. If you're just asking how you can structure a page with multiple forms where you can figure out which form was submitted, there's a post about that here: http://w3schools.invisionzone.com/topic/12509-php-tips-and-tutorials/ I would assume that the trigger would update the timestamp, but the final word there is to just test it.
  9. touchstart and click on refresh only

    The developer tools in Chrome is not showing that there are nay errors! Any other place I can go that may identified errors? Thank you
  10. How to compare two numbebrs

    If you want to read the first 2 characters you can use left: https://www.w3schools.com/asp/func_left.asp You're comparing characters and numbers. When you do that it converts the characters to numbers, and if you look at a character table, "A" is 65 and "a" is 97, so it's never going to be less than 8. If you want to compare them like numbers then convert the characters to numbers first. You can use CInt. https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/type-conversion-functions
  11. touchstart and click on refresh only

    There's not really enough context to suggest what the problem is, but the first step is to make sure you're finding Javascript error messages if there are any.
  12. Yesterday
  13. Date time not working...

    Can you give me a hand with the code? I need to open a stream between sunday 9:55PM and monday 1:30AM. I have solved the problem with 2 PHP's but I think it's not the best way.
  14. I have a very simple code that often only works after I get to the page, then ask for the page to reload. If I click the button without reloading, nothing happens. If I click after page refresh, it works perfect. Thank you for your help. This page has a few tables all brought in by PHP select statements etc. Could that possible have some anything to do with it? <script> $(document).ready(function(){ //OPENING PRIMARY $('.OpenerPri').on ('touchstart click',function() { var ppNum = ($(this).val()); var callType = 'opener_pri'; ($(this).prop('disabled', true)); ($(this).html('Thx')); $.post("reservecall.php", { ppnum:ppNum, calltype:callType }, function(data, status){ alert("Data: " + data + "\nStatus: " + status); }); }); }); </script>
  15. Two Forms, Two Actions, Same Page

    BACKGROUND: Good ideas are sometimes like luck, they come in streaks. Thanks to the experiential wisdom of this forum and those around me in the Galvanize collective workspace, I have decided to tarry a little longer with the reconstruction of my data base. Indeed, I have learned a new term -- normalization. What before I intended to achieve with row duplication I hope now to achieve with simple updates. In order to achieve this important structural change and still retain the benefits of the old structure, I must disengage one of my form's <fieldset>s and create from it a new form that is submitted manually and only occasionally. It would appear that the small changes to the separate table that this fieldset previously replenished with each new form submission can now be achieved with MySQL TRIGGER and UPDATE statements. This strategy has led to the following two questions: QUESTION ONE: Under the assumption that one can have only one $_POST variable per page how does one typically go about using the same $_POST variable for multiple forms on the same page? If I were to implement this task on my own, without the advice of others, I would create a bivariate if-. else if-, else- statement that tests for the present of one of two variables and then handles only that data associated with the form submitted. Is there another, perhaps more thorough, separation that does not include the creation of a separate form page? QUESTION TWO: When executing a MySQL TRIGGER that updates a single row value of a single column of a table different from the one that executes the trigger, will the DEFAULT setting for the UPDATE statement trigger a timestamp with the ON UPDATE CURRENT_TIMESTAMP? As always your wisdom would be well-appreciated. Roddy
  16. How to compare two numbebrs

    Hi, First I will have to read a value. Then read first two characters of the value. Then compare the value to see it it is greater than 8. First two characters sometimes can be null, string, alphanumeric or numeric. miless = "2mile(s)" myMile = mid(miless,1,2) print myMile If myMile>8 then print "a>b" End If It is always returning true even though first two characters are not numbers or less than 8. How can I do it?
  17. why the damn (')?

    ORDER BY order You should have noticed that when you were writing the code, ORDER is obviously a reserved word. If you're going to use reserved words as identifiers then you need to surround them with backticks so that MySQL knows you are referring to an identifier instead of the reserved word.
  18. How Is W3Schools Now ?

    i like the place no matter how it looks one possible reason might be relate to the latest php update a lot of sites had troubles
  19. loop input for each string

    Well i don't understand that? I ran the code with submit and it ran fine! That suggests you are gathering all the values and placing in a single input?
  20. loop input for each string

    ok I've wrong with the submit button, now the input appears with the string like this,
  21. why the damn (')?

    'order' or ORDER? 'order' is the problem, it is treated as SQL ORDER and in the wrong position, therefore an error is produced. even 'name' and 'level' are keywords, with as mentioned order being reserved https://dev.mysql.com/doc/refman/5.7/en/keywords.html#keywords-5-7-detailed-N
  22. why the damn (')?

    hmm... i tried to remove to ORDER from the SQL also but didn't work for some reason, which is why i'm kinda confused.. should be working. Or at least that is what i remember that it should :/...
  23. why the damn (')?

    I would imagine it would be "p1_c_c_order AS order" causing problem as ORDER is reserved for sorting in SQL, by using backticks it eliminates the conflict.
  24. loop input for each string

    It works for me once I add the required submit button. Note: don't use count use index.
  25. why the damn (')?

    hey W3S! Been a while! Anyhow, i have a question regarding my SQL... not sure, since it's been a while. So i am running latest version of WinginX with PHP 7.1 and PhpMyAdmin latest version all... i tried to run this SQL, which usually works: SELECT p1_c_c_id AS id, p1_c_c_name AS name, p1_c_c_level AS level, p1_c_c_order AS order FROM plugin1_class_categories ORDER BY order ASC and i got the error below: Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in <path> Stack trace: #0 {main} thrown in <path> on line 131 so then i went nuts and went to the PhpMyAdmin sql builder and it builded this for me: SELECT `p1_c_c_id` AS `id`, `p1_c_c_name` AS `name`, `p1_c_c_level` AS `level`, `p1_c_c_order` AS `order` FROM `plugin1_class_categories` ORDER BY `p1_c_c_order` ASC and that works? Only difference is the plinges... the (')... why? The other one usually works also right? Or am i remembering wrong? Tried to read a little bit about it but gave no sence since it's been a while with everything hehe Well thanks if you can help me anyways! Thanks in advance!
  26. loop input for each string

    thanks, I have tried to do your indications like this, var count = 1; $(function () { $('#submit').click(function () { var met = $('#nom').val(); var metiers = met.split(', '); var join = ""; $.each(metiers, function(index, valeur) { join += valeur + "<br>"; var element = document.createElement("input"); element.setAttribute("type", "text"); element.setAttribute("value", valeur); element.setAttribute("name", "txtbox"+ count); var vals = document.getElementById("inputbox"); vals.appendChild(element); var br = document.createElement("br"); vals.appendChild(br); }); }) }); <div id = "inputbox"> <input type="text" value="A, B, C, D" id="nom"> </div> I don't know where is wrong but the input doesn't appears
  1. Load more activity