newnew Posted March 22, 2009 Report Share Posted March 22, 2009 Ir kkāds select boxis ar vairākām vērtībām. Man vajaga ieselektēt select box to vērtību, kuras value = 'xxxx". (pēc zināma value ieselektēt atbilstošo select boxi). Quote Link to comment Share on other sites More sharing options...
0 bubu Posted March 22, 2009 Report Share Posted March 22, 2009 šitā? select_elements.value = "xxxx"; Quote Link to comment Share on other sites More sharing options...
0 indoom Posted March 23, 2009 Report Share Posted March 23, 2009 var a = document.getElementById('select_id'); for (var i = 0, l = a.options.length; i < l; ++i) { if (a.options[i].value == 'xxxx') { a.options[i].selected="selected"; break; } } Quote Link to comment Share on other sites More sharing options...
0 bubu Posted March 23, 2009 Report Share Posted March 23, 2009 Kāpēc tik sarežģīti, indoom? document.getElementById('select_id').value = "xxxx"; Quote Link to comment Share on other sites More sharing options...
0 indoom Posted March 23, 2009 Report Share Posted March 23, 2009 Šitādu joku nemaz i nezināju :) Quote Link to comment Share on other sites More sharing options...
Question
newnew
Ir kkāds select boxis ar vairākām vērtībām.
Man vajaga ieselektēt select box to vērtību, kuras value = 'xxxx". (pēc zināma value ieselektēt atbilstošo select boxi).
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.