in reply to Re^2: JSON Return Values
in thread JSON Return Values

The data back from JSON includes "position":"3" so the information is there.

The javascript looks good:

(function ($) { $.fn.loadJSON = function (obj, options) { function setElementValue(element, value, name) { var type = element.type || element.tagName; if (type == null) return; type = type.toLowerCase(); switch (type) { case 'radio': if (value.toString().toLowerCase() == element.valu +e.toLowerCase()) $(element).attr("checked", "checked"); break; case 'checkbox': if (value) $(element).attr("checked", "checked"); break; case 'select-multiple': var values = value.constructor == Array ? value : +[value]; for (var i = 0; i < element.options.length; i++) { for (var j = 0; j < values.length; j++) { element.options[i].selected |= element.opt +ions[i].value == values[j]; } } break; case 'select': case 'select-one': case 'text': case 'hidden': $(element).attr("value", value); break;

At a loss. I don't see "value as either a global attribute or an attribute of select.

Attributes defines: value <button>, <input>,

  • , <option>, <meter>, <progress>, <param>

    So it is an attribute of option not select

  • Replies are listed 'Best First'.
    Re^4: JSON Return Values
    by tultalk (Monk) on Mar 23, 2018 at 16:47 UTC

      Resolved by using a more recent script as suggested on jquery forum.

      Thanks>