jimbourekas@yahoo.gr 1 Posted July 5, 2013 Report Share Posted July 5, 2013 Hello, I have the following UI Panel code: ui html panel("<!DOCTYPE html> <html> <body> <div> <select variable=\"#myvar2\" fillwith=\"value\" id=\"icd10\" onchange=\"doIt();\"> <option value=\"United States\">United States</option> <option value=\"United Kingdom\">United Kingdom</option> <option value=\"Afghanistan\">Afghanistan</option> </select> <div id=\"hiddenIcd10\" variable=\"#myvar\" fillwith=\"innertext\"></div> </div> </body> <script> function doIt()\{ document.getElementById(\"hiddenIcd10\").innerText=document.getElementById(\"icd10\").value; \} </script> </html> ", 135)There is one select and one div, both with assigned variables. The special thing here is that I have an event on the select that changes the innertext of the div. The result is that when the select changes, the div changes but only for a moment. Then ubot overwrites the value of the div blank. Any ideas to overcome this would be very welcome. Regards, Jim Quote Link to post Share on other sites
jimbourekas@yahoo.gr 1 Posted July 5, 2013 Author Report Share Posted July 5, 2013 Ok, after I contacted support, Robert was very kind to give me the solution. Apparently, the value gets overwritten, that's a truth. The solution is to make my 'onchange' event trigger a ubot function that sets the "variable" param. I attach the fixed script. jimskata2 - fixed.ubot Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted April 23, 2016 Report Share Posted April 23, 2016 Old thread i know, .. but saved my life never the less, i was trying to use "onselected" and a million variations of, CheersCJ Quote Link to post Share on other sites
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.