I have a form with code like the following snippet:

```
<div class="form-group">
    <div class="col-md-12">
        <input type="text" required="" name="n_p1" class="form-control depox" placeholder="Nama Penumpang">
    </div>
</div>

<div class="form-group">
    <div class="col-md-12">
        <input type="text" required="" name="t_p1" class="form-control depox" placeholder="Nomor HP">

    </div>
</div>

<div class="form-group">
    <div class="col-md-12">
        <input type="text" required="" name="l_p1" class="form-control depox" placeholder="Alamat Penjemputan">
    </div>
</div>

<div class="form-group">
    <div class="col-md-12">
        <input type="text" required="" name="l_t1" class="form-control depox" placeholder="Alamat Tujuan">
    </div>
</div>

```

I have the "Add button" 

```
<span rel="tooltip" title="Klik untuk menambah penumpang" class="pull-right fa fa-plus fa-3x hover-depox" onclick="addPassenger();"></span>

```

which serves to add elements such as the above. When the button is clicked, it will run `addPassenger()` function increments the value will be "n". the value "n" is used to accommodate the array of data in PHP from the input name attribute. 

I also have a "Remove button" that will perform the `remPassenger(m)` function:

```
<a onclick="remPassenger('+ (n-1) +')" class="text-warning pull-right"><span class="fa fa-times"></span></a>

```

This is the jquery that there are 2 functions as above.

```
var total_passenger = 1;
function addPassenger() {
    var n = total_passenger+1;
    var str = "<hr style=\"border-bottom: 1px solid #fff;\">";
    str += '<div class="form-group"><div class="col-md-12"><input type="text" name="n_p' + n + '" class="form-control depox" placeholder="Nama Penumpang ke-' + n + '"></div></div><div class="form-group"><div class="col-md-12"><input name="t_p' + n + '" type="text" class="form-control depox" placeholder="No HP Penumpang ke-' + n + '"></div></div><div class="form-group"><div class="col-md-12"><input name="l_p' + n + '" type="text" class="form-control depox" placeholder="Lokasi Penjemputan Penumpang ke-' + n + '"></div></div><div class="form-group"><div class="col-md-12"><input name="l_t' + n + '" type="text" class="form-control depox" placeholder="Alamat Tujuan Penumpang ke-' + n + '"></div></div><div id="add-passenger' + n + '" style="display: none;"></div>';
    jQuery('#add-passenger' + total_passenger.toString()).append(str);
    jQuery('#add-passenger' + total_passenger.toString()).slideDown('medium');
    total_passenger++;
}

function remPassenger(m){
    total_passenger--;
    jQuery('#add-passenger' + m).remove();

}

```

This will fill the jquery element into to accommodate the elements if the button is clicked and remove the elements from the .

```
<div id="add-passenger1" style="display: none;"></div>

```

My Problem is when i click "Add Button" and normally then i use "Remove Button" click and it's worked, then i click "Add Button" again. it cant works.

Note: You can visit my site in <http://stage.travelcar.co.id> go through the steps until you find the form "Data Pemesanan"