Home » Php » javascript – The specified value "\t1750000" is not a valid number

javascript – The specified value "\t1750000" is not a valid number

Posted by: admin February 25, 2020 Leave a comment


I got this error when choosing data from the selected form.
When total prices should have been selected, this should not appear.
I use the input type number, but when using the input type text, the total price appears.

I will write the code below

enter image description here

function hitungpaketaqiqahsatuan(){
    var id_paketaqiqah=$("#id_paketaqiqah").val();
    var layanan_paketaqiqah="Masak";
    var jumlah_paketaqiqah=$("#jumlah_paketaqiqah").val();

      url:'<?php echo base_url(); ?>ajax/hitungpaketaqiqahlagi/',     
      cache: false,
        id_paketaqiqah: id_paketaqiqah,
        jumlah_paketaqiqah: jumlah_paketaqiqah
  <div class="form-group">
            <input onkeyup="hitungpaketaqiqahsatuan()" onchange="hitungpaketaqiqahsatuan()"  type="number" class="form-control" placeholder="Jumlah" name="jumlah_paketaqiqah" id="jumlah_paketaqiqah" min="1" value="1" required>
           <div class="form-group">
            <input type="number" class="form-control" placeholder="Total" name="total_pesanan_hewan" id="total_pesanan_hewan" disabled required>
public function hitungpaketaqiqahlagi()
        $id_paketaqiqah = $this->input->post('id_paketaqiqah');
        $jumlahpaket = $this->input->post('jumlah_paketaqiqah');
        $paket_aqiqah = $this->pam->getSinglePaketaqiqah($id_paketaqiqah);

        foreach ($paket_aqiqah->result() as $pa) {
            $harga_paketaqiqah = $pa->harga_masak;

            $total = $jumlahpaket*$harga_paketaqiqah;                   

            echo $total;
How to&Answers: