model view controller - Add two string in jQuery -


i trying add 2 string , pass 1 throught ajax controller:

var hours = $('#hours').val(); var mintues = $('#minutes').val();        var todbviewmodel = {                            clientid: clientid,                            projectid: projectid,                            taskid: taskid,                            description: description,                            duration: hours + minutes                        } 

when json reach controller value of duration ( let hours = 3):

"3[ojbect htmlinputelement]" 

whenever hour minutes "[ojbect htmlinputelement]"

what do wrong?

--edit--

<input id="hours" type="number" class="form-control" style="width: 70px" placeholder="h" />  <input id="minutes" type="number" class="form-control" style="width: 70px" placeholder="m" /> 

concatenate first , pass json

if see demo , working properly

 var hours = $('#hours').val(); var mintues = $('#minutes').val();  var hours_min=hours +"."+mintues ;      var todbviewmodel = {                            clientid: clientid,                            projectid: projectid,                            taskid: taskid,                            description: description,                            duration: hours_min                        } 

Comments