Mrcrix 10 Posted September 17, 2012 Report Share Posted September 17, 2012 Hello. I'm pretty sure to know already the answer but I try to ask it anyway. Is there a way to make this script work (to set correctly the variable) inside LOAD HTML command? load html(" <select size=\"5\" variable=\"#project\" fillwith=\"value\"><option>Website</option><option>Domains</option><option>Directory</option></select> <button onclick=\"ubot.runScript(Load project()')\">Load</button>") The define "Load project" should just get the variable #project and make some things with it. It's working normally if used in UI html Window or UI html Panel but I would need it in the Load html command... If anybody could be give me a suggestion it will be apreciated! Quote Link to post Share on other sites
k1lv9h 76 Posted September 17, 2012 Report Share Posted September 17, 2012 Hi, This seemed to work:load html(" <form name=\"testme\"> <select name=\"proj\" size=\"5\" variable=\"#project\" fillwith=\"value\"> <option>Website</option><option>Domains</option><option>Directory</option> </select> </form> <button onclick=\"ubot.runScript(\'Load project()\')\">Load</button> ") define Load project { set(#project, $eval("document.testme.proj.options[document.testme.proj.selectedIndex].value"), "Global") alert("run {#project}") } Got the button to work. Code will now get the selected value from the page. Kevin Quote Link to post Share on other sites
Mrcrix 10 Posted September 20, 2012 Author Report Share Posted September 20, 2012 Hi Kevin, yes the solution you provided is working correctly and gave me even a new way on how to run commands, Thanx a lot!! Cris Quote Link to post Share on other sites
Frank 177 Posted July 23, 2015 Report Share Posted July 23, 2015 That's pretty awesome! An old post but definitely still works and is a goodie! Frank Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted October 19, 2016 Report Share Posted October 19, 2016 Hi, This seemed to work: load html(" <form name=\"testme\"> <select name=\"proj\" size=\"5\" variable=\"#project\" fillwith=\"value\"> <option>Website</option><option>Domains</option><option>Directory</option> </select> </form> <button onclick=\"ubot.runScript(\'Load project()\')\">Load</button> ") define Load project { set(#project, $eval("document.testme.proj.options[document.testme.proj.selectedIndex].value"), "Global") alert("run {#project}") }Got the button to work. Code will now get the selected value from the page. Kevin Hey Kevin, Sorry to bring a 4 year old post up, and sorry to the thread starter for hijacking lol, ..but do you (or anyone reading) know of a way to get the same result with a UI HTML "Panel" ? Ive tried a shed load of possible javascript, Jquery combinations but I can not get a js variable back into a UBot variable from a UI Panel, .. no problems what so ever doing the exact same thing within a Load HTML, There must be a way .... right ? Anyone please feel free to jump in and say something like "of course its possible you idiot", ... and then point out how simple it actually is, .. I would rather look stupid than find out its impossible 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.