Hi,
I’m using JavaScript to set the selected option after a form has been generated, and have been using:
$('select',form.itemPull[form.idPrefix + id]).val(value).attr('selected','selected');
(Using jQuery, where form is the DHTMLXForm object, id and value are self explanatory).
However, this doesn’t work if the field is within a fieldset.
Any ideas?
Andrei
#2
Hi
Correct, fieldset have nested form.
Also this method is not public.
Thanks for the reply.
How should I be setting the selected option then?
Andrei
#5
myForm.setItemValue(name,value);
ex:
{type: "select", label: "Format", name: "format", options:[
{text: "AAC", value: "AAC"},
{text: "AC3", value: "AC3", selected: true},
{text: "MP3", value: "MP3"},
{text: "FLAC", value: "FLAC"}
}
AC3 will selected by the default,
myForm.setItemValue("format","AAC");
will select AAC