javascript - hidden field value contains [object object] -


I am setting hidden field values ​​in jquery script, but hidden fields have result values, in which [object object]

Here are the values;

"[Object object], 22-Apr-2014"

script

  var indx = 0; var hdfield = $ ('# hdlstVisitDates'); var lst = $ ('# lstVisitDates'); var option = $ ('# lstVisitDates option'); $ (Options) .each (function () {if (indx = 0) {hdfield = $ (this) .val (); indx = 1;} else {hdfield = hdfield + ',' + $ (this) .val ();}}); $ ('# HdlstVisitDates') val (hdfield).  hdfile  with  $ ('#')    

< p> HdlstVisitDates') because you are going to overwrite the value later, if you have if (indx = 0) { which will always evaluate false, Should be (if index == 0) {
  var indx = 0; var hdfield; // = $ ('# hdlstVisitDates'); Why this? var lst = $ ('# lstVisitDates'); var option = $ ('# lstVisitDates option'); $ (Option) .each (function () {if (Indx == 0) {hdfield = $ (this) .val (); indx = 1;} and {hdfield = hdfield + ',' + $ (this) val ();}}); $ ('# HdlstVisitDates') val (hdfield).    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -