Jump to content



Photo

[Solved]Hide/disable Button After Click ?

uihtml javascript

  • Please log in to reply
4 replies to this topic

#1 Vladislav

Vladislav

    Member

  • Fellow UBotter
  • PipPip
  • 28 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 08 August 2016 - 11:03 AM

Hi great ubot community!

 

Can someone point me to some tutorial or explain with simple words how one can disable or hide UI HTML button after click ?

 

In a bot i am currently building i have "Start" button build via  ui html command, i want after clicking it, the button to become disabled/hidden or both.

 

Can someone please help me with this issue ?



#2 pash

pash

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3517 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 August 2016 - 01:40 AM

i not good html

i thing this help you

 

http://stackoverflow...the-button-once

http://network.ubots...ton-in-ui-html/

ui html panel("<button type=\"button\" onclick=\"this.disabled = \'disabled\' ;ubot.runScript(\'ClearTemp()\');\">Click Me!</button>",200)
define ClearTemp {
    alert("Success")
}

New Plugin:: Advanced Facebook | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint
- Advanced Data Text File | Advanced DateTime | Advanced Dialog | Advanced Document | Advanced Google Blogger V3 | Advanced Google Drive | Advanced Google YouTube V3 | Advanced Image | Advanced Video | Advanced Screen and Windows | Advanced Systems | Advanced Ubot 1 | Advanced Ubot 2 | Advanced WordPress | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint

- Advanced Captcha (V3) | Advanced Captcha (V2) (Old) | Create Table From Excel (Lite) | Check Conection | Ubot Enter License | Auto Free Memory
- Working hours GMT+7. i regret sometimes the answer is delayed due to health problems.


#3 darryl561

darryl561

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 561 posts
  • LocationAustralia
  • OS:Windows 7
  • Total Memory:2Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 09 August 2016 - 02:07 AM

This example code will hide and disable the button

on load("Bot Loaded") {
    set(#start button,"<button onclick=\"ubot.runScript(\'run()\')\">start</button>","Global")
}
ui html panel("<span variable=\"#start button\" fillwith=\"innerhtml\"></span>",100)
define run {
    set(#start button,$nothing,"Global")
    wait(2)
    set(#start button,"<button onclick=\"ubot.runScript(\'run()\')\">start</button>","Global")
}

herosig.jpg

UI Editor Genie                                 GUI Hero


#4 darryl561

darryl561

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 561 posts
  • LocationAustralia
  • OS:Windows 7
  • Total Memory:2Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 09 August 2016 - 03:10 AM

Here is another method to disable and then re-enable a button

ui html panel("<html><head>
<script>
function disableElement()
\{
document.getElementById(\"thatbutton\").disabled=true;
\}
function enableElement()
\{
document.getElementById(\"thatbutton\").disabled=false;
\}
    window.onload = startInterval;
    function startInterval()
    \{
        setInterval(\"reloadscript();\",300);
    \}
    
    function reloadscript()
    \{
              
if (document.getElementById(\"enablebuttonplz\")) \{
    enableElement();
\}
\}
</script>
</head><body>
<button onclick=\"disableElement();ubot.runScript(\'okaybutton()\')\" id=\"thatbutton\">OK</button>
<span variable=\"#enabledisable\" fillwith=\"innerhtml\">


</body></html>","")
define okaybutton {
    wait(3)
    set(#enabledisable,"<div id=\"enablebuttonplz\"></div>","Global")
    wait(1)
    set(#enabledisable,"<div></div>","Global")
    alert("done !")
}

herosig.jpg

UI Editor Genie                                 GUI Hero


#5 Vladislav

Vladislav

    Member

  • Fellow UBotter
  • PipPip
  • 28 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.0
  • License:Developer Edition

Posted 16 August 2016 - 07:07 AM

Thank you pash and daryl561 for helping me solve this issue!







Also tagged with one or more of these keywords: uihtml, javascript

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users