Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I try to solve the problem with a different approach, moving out the "long data" from select block into an another kind of form more easy to manage.<br/> Here's a draft of my idea:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; .clickme{ text-decoration: underline; color: blue; } &lt;/style&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var iban=[ [{"idx":"11","iban":"CH12 3456 7890 1234 5678 9"},{"idx":"12","iban":"CH12 3333 3333 3333 3333 9"}], [{"idx":"13","iban":"CH99 3333 3333 3333 3333 9"}], [{"idx":"14","iban":"CH88 3333 3333 3333 3333 9"},{"idx":"15","iban":"CH77 3333 3333 3333 3333 9"}] ]; $().ready(function(){ $(".select_show").change(function(){ var testo=""; for( var t in iban[ $(this).val() ]){ if(testo==""){ testo="Please select one following iban&lt;br/&gt;"; } testo=testo + "&lt;div class='clickme' value='"+ iban[ $(this).val() ][t].idx +"'&gt;"+ iban[ $(this).val() ][t].iban +"&lt;/div&gt;&lt;br/&gt;"; } $("#choices").html(testo); $(".clickme").click(function(){ $("#hidden1").val($(this).attr('value')); $("#choices").html("thanks"); }); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body &gt; &lt;form&gt; &lt;input type="text" id="hidden1" name="real_select_input" value=""&gt; &lt;br/&gt; &lt;select class="select_show" id="select1"&gt; &lt;option selected="selected" value="-1"&gt;please select&lt;/option&gt; &lt;option value="0"&gt;[AccountType] [EUR] - [Customer1]&lt;/option&gt; &lt;option value="1"&gt;[AccountType] [EUR] - [Customer2]&lt;/option&gt; &lt;option value="2"&gt;[AccountType] [EUR] - [Customer3]&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; &lt;div id="choices"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Iban is an array of array: the first level contain your different accounts the second one the different profile for each customer.</p> <p>the "hidden1" is suppose to be hidden :)</p> <p>PS I was missed the comment of hunter on "Dec 29 '10 at 14:42" pointing this way</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload