I am trying to solve a problem with a different approach, forcing "long data" from the selected block into another form, more convenient for management.
Here is a draft of my idea:
<!DOCTYPE html> <html> <head> <style> .clickme{ text-decoration: underline; color: blue; } </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> 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<br/>"; } testo=testo + "<div class='clickme' value='"+ iban[ $(this).val() ][t].idx +"'>"+ iban[ $(this).val() ][t].iban +"</div><br/>"; } $("#choices").html(testo); $(".clickme").click(function(){ $("#hidden1").val($(this).attr('value')); $("#choices").html("thanks"); }); }); }); </script> </head> <body > <form> <input type="text" id="hidden1" name="real_select_input" value=""> <br/> <select class="select_show" id="select1"> <option selected="selected" value="-1">please select</option> <option value="0">[AccountType] [EUR] - [Customer1]</option> <option value="1">[AccountType] [EUR] - [Customer2]</option> <option value="2">[AccountType] [EUR] - [Customer3]</option> </select> </form> <div id="choices"> </div> </body> </html>
Iban is an array of arrays: the first level contains your different accounts; the second - a different profile for each client.
"hidden1" is supposed to be hidden :)
PS I was missed the hunter's comment on "December 29, 2010 at 14:42", thus indicating
source share