#javascript widget

select option value

Hello!!!

I have a question, is there anyway to make trough javascript put a value on a select widget.

Example

my select widget have loaded 3 items

p1
p2
p3

and i want when the form start that the widget start with the value p1, but if i change another field the select take a value that is needed.

is that posible???

my select is on a $item.

i have tried to make this

$data.forminput.variableinput.items[1].provider.id=1;

but when i try that the system tell me that is undefined...

so what can i do???

Notifications