select html to json conversion
<p>I have an alpaca form with select ui element where I can select multiple values and save the form.When i save the form the JSON using <code>JSON.stringify(val)</code> the generated of the form is having problem. JSON is having only ids of selected elements.I want the JSON containing both the ids and values</p>

<pre><code>&lt;select id="alpaca4" multiple="multiple" size="5" name="roles" class="alpaca-control form-control"&gt;
&lt;option value="1"&gt;one&lt;/option&gt;
&lt;option value="2"&gt;two&lt;/option&gt; 
&lt;/select&gt;
</code></pre>

<p>The generated json format is :</p>

<pre><code>{"roles":["1","2"]}
</code></pre>

<p>The format iam expecting is :</p>

<pre><code>{"roles":["1":"One","2":"Two"]}
</code></pre>