Jump to content
UBot Underground

How to call javascript function inside UI html Panel


Recommended Posts

I am new to ubot 4 and working on creating two drop down in UI html panel which will be dynamically populated based on article directories browsed

 

when account get created on one site it gets moved from one drop down to another, for this purpose i have written code as below which is including javascript for removing from one drop down and adding to another drop down, but till now i was having button to make this happen. but now i want to call javascript function when variable value gets changed like this

 

<span variable=\"#previoussite\" fillwith=\"innertext\" class=\"style1\" document.addOption_list()></span>

 

javascript used is

 

 

<script>

 

function addOption(selectbox,text,value )

\{

var optn = document.createElement(\"OPTION\");

optn.text = text;

optn.value = value;

selectbox.options.add(optn);

\}

 

function removeOption(listbox,i)

\{

listbox.remove(i);

\}

 

function addOption_list(i)\{

var Category=document.drop_list.Category;

addOption(document.drop_list.SubCat, document.drop_list.Category.value, document.drop_list.Category.value);

removeOption(Category,i);

\}

 

 

</script>

 

 

 

<form name=\"drop_list\">

<select name=\"Category\" multiple=\"multiple\" size=\"7\"><option value=\"www.article.com\">www.article.com</option></select> 

<input onclick=\"addOption_list(0)\" ;=\"\" value=\"Move >\" type=\"button\">

<select id=\"SubCat\" name=\"SubCat\" multiple=\"multiple\" size=\"7\"></select>

 

</form>

 

is there any way so that i can call javascript method addOption_list(0) when #previoussite has new value.

Link to post
Share on other sites

You need to embed it in the HTML UI Panel... something like this...

 

ui html panel("<!DOCTYPE html>

<html>

<head>

<script type=\"text/javascript\">

<!--

 

function addOption(selectbox,text,value )

\{

var optn = document.createElement(\"OPTION\");

optn.text = text;

optn.value = value;

selectbox.options.add(optn);

\}

 

function removeOption(listbox,i)

\{

listbox.remove(i);

\}

 

function addOption_list(i)\{

var Category=document.drop_list.Category;

addOption(document.drop_list.SubCat, document.drop_list.Category.value, document.drop_list.Category.value);

removeOption(Category,i);

\}

 

//-->

</script>

</head>

<body>

 

<form name=\"drop_list\">

 

<select name=\"Category\" multiple=\"multiple\" size=\"7\"><option value=\"www.article.com\">www.article.com</option></select> 

<input onclick=\"addOption_list(0)\" ;=\"\" value=\"Move >\" type=\"button\">

<select id=\"SubCat\" name=\"SubCat\" multiple=\"multiple\" size=\"7\"></select>

 

</form>

 

</body>

</html>", 150)

Link to post
Share on other sites

ohh that not my concern, actually i am confused of way to call javascript function inside UI html panel when article directory account gets created. like when variable #previoussite gets updated

basically i dont want to click move button each time account gets created on new Article Directory url. there should be a way that java script method gets invoked

Thanks for prompt reply Duane

Link to post
Share on other sites

In a UI HTML Panel, or window once its loaded its loaded.. Less using ajax, or jquery and calling it with an onclick function.

 

 

examples of use

onclick="javascript: function('value')"

onclick="function('value')"

onclick="return function('value')"

 

would be added to a link like

 

<a href="" onclick="return function('value')">Click Here</a>

 

Button

<button onclick="return function('value')">Click Here</button>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...