Answers for "how to put multiple parameters input html"

C#
2

how set multiple input form with the same name

<input name="xyz[]" value="Lorem" />
<input name="xyz[]" value="ipsum"  />
<input name="xyz[]" value="dolor" />
<input name="xyz[]" value="sit" />
<input name="xyz[]" value="amet" />

  
$_POST['xyz'][0] == 'Lorem'
$_POST['xyz'][4] == 'amet'
Posted by: Guest on April-17-2021
0

how to add multiple input value in javascript

$(document).ready(function(){

    //iterate through each textboxes and add keyup
    //handler to trigger sum event
    $(".input-number").each(function() {

        $(this).keyup(function(){
            calculateSum();
        });
    });

});

function calculateSum() {

    var sum = 0;
    //iterate through each textboxes and add the values
    $(".input-number").each(function() {

        //add only if the value is number
        if(!isNaN(this.value) && this.value.length!=0) {
            sum += parseFloat(this.value);
        }

    });
    //.toFixed() method will roundoff the final sum to 2 decimal places
    $("#sum").html(sum.toFixed(2));
}
Posted by: Guest on September-19-2021

Code answers related to "how to put multiple parameters input html"

C# Answers by Framework

Browse Popular Code Answers by Language