You need to sign in to do that
Don't have an account?

how to find a index value from select list
Hi folks,
i have a small issue with finding value from selectoptions.i.e, from the URL am getting a value.Now i need to search this value in an select list(<select>) and i need to know the index of the particular value.
VF :These are select list
<select id="timeperiodname" onchange="doSearch();" >
<option value=""></option>
<apex:repeat value="{!allperiods}" var="accnt">
<option value="{!accnt.name}">{!accnt.name}</option>
</apex:repeat>
<option value="H1">H1</option>
<option value="H2">H2</option>
<option value="F1">F1</option>
</select>
From the URL,am getting " H1 ".Now i need to search this value in select list and i need to find the index of the particular value.
how can i achieve this?plz,suggest me..
i have a small issue with finding value from selectoptions.i.e, from the URL am getting a value.Now i need to search this value in an select list(<select>) and i need to know the index of the particular value.
VF :These are select list
<select id="timeperiodname" onchange="doSearch();" >
<option value=""></option>
<apex:repeat value="{!allperiods}" var="accnt">
<option value="{!accnt.name}">{!accnt.name}</option>
</apex:repeat>
<option value="H1">H1</option>
<option value="H2">H2</option>
<option value="F1">F1</option>
</select>
From the URL,am getting " H1 ".Now i need to search this value in select list and i need to find the index of the particular value.
how can i achieve this?plz,suggest me..
See the links below which have sample code for passing Selected Picklist Values,
http://www.infallibletechie.com/2013/03/how-to-send-picklist-values-from-one-vf.html
https://developer.salesforce.com/forums?id=906F00000009886IAA
Regards,
Ashish