Sorry I'm not sure I have explained well
In the selection-list (dropdown) I will eventually want the html to look
like this
<option value="Alabama">AL</option>
<option value="Alaska" selected>AK</option>
<option value="Wyoming">WY</option>
Where "AK" is the selected value
hence the line:
form.getWidget("myStateDropDown").setValue("AK");
----- Original Message -----
From: "Antonio Gallardo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 24, 2003 4:40 PM
Subject: Re: Selecting the correct value in a selection-list
> Joe Latty dijo:
> > I have searched through the archives and docs to no avail.
> >
> > In the scenario where I have a selection list built up in javascript
> >
> > var states = [
> > { key: "AL", value: "Alabama" },
> > { key: "AK", value: "Alaska" },
> > { key: "WY", value: "Wyoming" }
> > ];
> >
> > I pass it into the form:
> > form.showForm(uri, { "states" : states });
> >
> > and in the field I have the following element:
> > <wd:selection-list type="flow-jxpath" list-path="states"
value-path="key"
> > label-path="value"/>
> >
> > How can I select a value eg "AK":
>
> I guess this can be a typo while writing the mail:
>
> > form.getWidget("myStateDropDown").setValue("AK");
>
> but to be sure, I wrote the correct one:
>
> form.getWidget("myStateDropDown").getValue();
>
> This solve your problem?
>
> Best Regards,
>
> Antonio Gallardo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]