Change the value of var and load php page

Asked

Viewed 39 times

0

onchange doesn’t work, it just works on the first selection, then it doesn’t. ideas ??

function getComboA(sel) {
    $(document).ready(function(){
        var id = sel.value;
        $('#frontend').bcp({
            'ID': id,
            'loadURL': 'bcp/db/carrega.php',
            'sendURL': 'bcp/db/send.php'
        });
    }) 
};
  • What do you have besides the first selection? What do you mean by "AFTER"?

  • because I have a select dropdown with airports, and if selecting Porto loads the availability of Porto, if it is Lisbon as Lisbon.. , that is, select your departure airport -> dropdown with value in foreach php from bd mysql .. I just want to change the select to change the var id to the corresponding value.

  • Data is uploaded and sent in json..

  • Because I have mastered PHP but Javascript doesn’t really.. and there must be something missing, some little code..

  • You recreated the element in the DOM?

  • Yes... this with gift I think yes

  • Every time you recreate the element, you have to call the function again.... test there and tell me if it worked ok?

  • Why not use Ajax? is very practical to work with php + ajax. See my example code http://answall.com/questions/144032/redirecionar-p%C3%A1gina-passing-Sponse-do-ajax-para-uma-div/144050#144050

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.