Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

vlafratta

@vlafratta
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How can I get an input value from ajax result search
    V vlafratta

    Finally could apply a solution: Replace the way how it's show the result from the ajax live search to this:

    COD: ' . $codice . ' - DESC: ' . $articolo . '

    For the Javascript, replace it with JQuery:

    $(document).ready(function(){
        
        $(".child span").click(function(){
           
            code = $(this).parent().attr('data-id');
            articolo = $(this).parent().attr('data-id2');
            window.opener.$('#codice').val(code);
            window.opener.$('#articolo').val(articolo);
            window.close();
        });
    

    })

    Thank you all. Valter.

    JavaScript database php html mysql question

  • How can I get an input value from ajax result search
    V vlafratta

    Ok, the main point in this post is to catch/select anye result from the search of the live search ajax, as you can see in the code, for every result there is a button (aggiungi or add) that should cover the base, but, on any product that i click, always is pass it the first result. Now I don't if this have to do with the fact that the document.getElementById is the problem and change it to byclassname or I don know. I am stuck in this particular matter. Thank you

    JavaScript database php html mysql question

  • How can I get an input value from ajax result search
    V vlafratta

    Hey ZurdoDev, do you mean after choose a product from the list? Yes, the main purpose is select the product and pass it (codice, articolo) pass it to the main window form, from there it will be inserted to mysql database. Main window(php) -> popup window/search product/select product(php/js) -> main window form(php) -> ok with your choice? yes -> pass it to the database (array to string). That will be the main structure. Thanks in advance.

    JavaScript database php html mysql question

  • How can I get an input value from ajax result search
    V vlafratta

    Hello, I'm new here. I am designing an intranet, of which I require that the user when making a request for a product will be able to select it directly from the database and send that request. From the page where the requests originate, I added a search button for the user to search for the specific product and add it to their product request, this was done with ajax live search. From the results of that search, a list is usually displayed with the possible results, the objective, and it is where I am blocked, is that from the list with the results, the user chooses the one he wants and this is inserted in the request for the parent page. I have these live search files in ajax, php and mysql: search-form.php (popup):

    $(document).ready(function(){
    load_data();
    function load_data(query)
    {
    $.ajax({
    url:"backend-search.php",
    method:"POST",
    data:{query:query},
    success:function(data){
    $('#result').html(data);
    }
    });
    }
    $('#search').keyup(function(){
    var search = $(this).val();
    if(search != ''){
    load_data(search);
    }else{
    load_data();
    }
    });
    });

    JavaScript database php html mysql question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups