ui dialog and live problem
I'm using the ui dialog to show an input form. I have a table where you can edit each row, the values from that row come into my ui dialog. When submitted it shows me the table with the updated values. This part works fine
When I want to edit a second row, it won't work. The ui dialog show up with the correct data, but when I edit that data and submit it he does not put the updated values in my table and doesn't close my ui dialog.
Here is my html code:
- <div id='dialog2' title='Wijzig' style='display:none;'>
- <form>
- <label id='label' for='artid'>Artikel:</label>
- <input type='text' id='artid' onkeyup='showOmschrijving();' /><br />
- <div id='labelInfo'></div>
- <label id='label' for='informatie'>Informatie:</label>
- <input type='text' id='informatie' /><br />
- <label id='label' for='code'>Code:</label>
- <input type='text' id='code' /><br />
- <label id='label' for='prijsArt'>Prijs:</label>
- <input type='text' id='prijsArt' class='prijsArt' /><br />
- <div id='msg' style='display:none;'></div>
- <label id='label'> </label>
- <button type='button' class='artToev' value='Artikel toevoegen'>Artikel toevoegen</button>
- </form>
- </div>
My js code:
- $('.artToev').live('click',function(e){
- var tekst = $('.artToev').val();
- var artikelid = $('#artid').val();
- var informatie = $('#informatie').val();
- var code = $('#code').val();
- var prijs = $('#prijsArt').val();
- var leverancier = $('select#leverancier').val();
- var actief = $('#actief'+artikelid).val();
- $.post('./artikelToevoegen.php',{artikelid: artikelid, informatie: informatie, code: code, prijs: prijs, actief: actief'},function(data){
- if(data != ""){
- $('#dialog2').dialog('close');
- $('div#overviewLeverancier').load("leverancier.php #artTabel", {lev: leverancier}, function(response){
- $('div#overviewLeverancier').html(response);
- return false;
- });
- } else {
- $('#msg').show();
- $('#msg').html('something wrong');
- }
- })
- });