JohnB 255 Posted January 17, 2012 Report Share Posted January 17, 2012 Hello everyone. For those of you that own a dev license and make good use of the ui html panel, I have some useful information for you. have you ever created a bot that was loaded with ui elements? Maybe to the point that space became an issue? Here is a time and space saving tip for you. Instead of using labels to explain the purpose of of an input box, why not place the instructions inside the box? You can do this with a simple addition to the attribute area of the input box. The best part is it will be coded to clear when you click on it to insert the desired data. The code is simple and uses just a small line of javascript. Here is an example: <input variable="#un" fillwith="value" type="text" id="username" value="Insert Username Here" size="30" onfocus="this.value='';return false;"> Now here is a little known feature: If you have the default form fields filled out in the options section, and have used those variable names in you script, they will pre-load in the ui html panel ui elements. John 1 Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted January 17, 2012 Report Share Posted January 17, 2012 Nice one John. This is helpful to reduce the size of our UI's.. Keep the tips coming. Quote Link to post Share on other sites
JohnB 255 Posted January 17, 2012 Author Report Share Posted January 17, 2012 Thanks Kreatus. I will probably post some more, but you guys can actually do what I am doing...going through the entire library of free snippets. There is a TON of really cool stuff there: http://javascriptsource.com/alphabetical-listing/?select=A I started in A and am currently in T...there is too much to post, but there is definitely something for everyone... A little tip: If the code requires a .js file, you can host it remotely and it will still function in the ui html panel. Just make sure you change the path. John Quote Link to post Share on other sites
sales 1 Posted January 22, 2012 Report Share Posted January 22, 2012 Thanks JohnB! I have learned more from you on this forum and your videos on http://learnubot.com than anywhere else. sales Quote Link to post Share on other sites
JohnB 255 Posted January 22, 2012 Author Report Share Posted January 22, 2012 Thanks JohnB! I have learned more from you on this forum and your videos on http://learnubot.com than anywhere else. sales Thank you sales! http://ubotstudio.com/forum/public/style_emoticons/default/smile.gif John Quote Link to post Share on other sites
UBotDev 276 Posted January 23, 2012 Report Share Posted January 23, 2012 Hey John, nice idea, but I have noticed that this stops working as soon as you use variable in code. I just added code set(#tmp, #un, "Global") bellow "UI HTML Node", and it stopped working... Any idea how to solve this? I talked with Eddie about related problem, but it looks like there is no solution - ubot will always clear that value on load. Quote Link to post Share on other sites
JohnB 255 Posted January 23, 2012 Author Report Share Posted January 23, 2012 I'm not sure what you mean...it seems to work fine for me... http://screencast.com/t/tLejx1iKA John Quote Link to post Share on other sites
AutoIM 5 Posted January 23, 2012 Report Share Posted January 23, 2012 Instead of using labels to explain the purpose of of an input box, why not place the instructions inside the box? You can do this with a simple addition to the attribute area of the input box. The best part is it will be coded to clear when you click on it to insert the desired data. The code is simple and uses just a small line of javascript. Here is an example: <input variable="#un" fillwith="value" type="text" id="username" value="Insert Username Here" size="30" onfocus="this.value='';return false;"> Now here is a little known feature: If you have the default form fields filled out in the options section, and have used those variable names in you script, they will pre-load in the ui html panel ui elements. John Hi John Thanks for the tip, it's very useful. I'll start to work through the A to Z examples too. I guess some of them can be combined with the css things I was working with here: http://ubotstudio.co...rowser-version/ too, so combining them could be very powerful. +1 from me, Phil Quote Link to post Share on other sites
UBotDev 276 Posted January 23, 2012 Report Share Posted January 23, 2012 I'm not sure what you mean...it seems to work fine for me... http://screencast.com/t/tLejx1iKA John Hey, The problem is that value of inuput box "Inser Username Here" disappears, when you add that second line of code. See video: http://screencast.com/t/tIDznFvp The same thing happens if I save, close and re-open the bot. Input box will have value "Insert Username Here" just for few mili seconds, that it will get cleared by ubot. Quote Link to post Share on other sites
JohnB 255 Posted January 23, 2012 Author Report Share Posted January 23, 2012 I am not seeing that: http://screencast.com/t/Hjwrwi3R Try clicking on new in the file menu, and you probably won't see that John Quote Link to post Share on other sites
UBotDev 276 Posted January 23, 2012 Report Share Posted January 23, 2012 I am not seeing that: http://screencast.com/t/Hjwrwi3R Try clicking on new in the file menu, and you probably won't see that John Strange, it doesnt work for me this way. :/ What happens if you save, close and reopen that bot with 2 nodes? Will it still show that value (Insert Username Here)? Here is a new video, demonstrating the issue: http://screencast.com/t/04CYSqbSFDR Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted February 7, 2012 Report Share Posted February 7, 2012 Here's a little trick to have tooltips on your UI's even if you only have standard license. ui text box("<span title=\"Enter your username\">Username:", #test username) ui text box("</span><span title=\"Enter your password\">Password:", #dsada2) Just make sure you put the <span> ending tag to the next UI. 3 Quote Link to post Share on other sites
JohnB 255 Posted February 7, 2012 Author Report Share Posted February 7, 2012 Here's a little trick to have tooltips on your UI's even if you only have standard license. ui text box("<span title=\"Enter your username\">Username:", #test username) ui text box("</span><span title=\"Enter your password\">Password:", #dsada2) Just make sure you put the <span> ending tag to the next UI. Nice share! +1 John Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted February 29, 2012 Report Share Posted February 29, 2012 <input variable="#un" fillwith="value" type="text" id="username" value="Insert Username Here" size="30" onfocus="this.value='';return false;"> Hi John, From your example code when you click on a textbox and focus on other textbox or element the initial value of that textbox will disappear. Do you know how to do something like the textboxes on this page https://www.facebook.com/pages/create.php that when you click on a textbox and didnt type anything there then move to another textbox the initial value will appear again. Thanks Quote Link to post Share on other sites
JohnB 255 Posted February 29, 2012 Author Report Share Posted February 29, 2012 I'm not sure, but I will investigate it. It certainly would make it much cooler if it's possible. John Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 10, 2012 Report Share Posted July 10, 2012 I'm not sure, but I will investigate it. It certainly would make it much cooler if it's possible. John Found it john. Just enter a placeholder tag.Here's a sample below:<input variable="#textbox" fillwith="value" type="text" name="textfield" placeholder="Enter Username" > <br> <input variable="#textbox" fillwith="value" type="text" name="textfield2" placeholder="Enter Password" > 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.