Jump to content
UBot Underground

Recommended Posts

I'm having trouble trying to get UBot to trigger DHTML events on the pages. In my WHM bot I'm trying to create accounts and part of that is choosing the package. It's a drop down box in a frame, and using select from dro down sets the package I want but does not trigger the onchange event:

 

<select onchange="updateform(document.mainform.msel.options[document.mainform.msel.selectedIndex].value)" name="msel" class="select" style="width:150px;">

 

 

This means that when I continue and create the account it's created with the default settings, not the package I've selected. If I do it outside UBot the onchange event is triggered and the package is set.

 

Is there a way to do this?

 

 

Link to post
Share on other sites

I'm having trouble trying to get UBot to trigger DHTML events on the pages. In my WHM bot I'm trying to create accounts and part of that is choosing the package. It's a drop down box in a frame, and using select from dro down sets the package I want but does not trigger the onchange event:

 

<select onchange="updateform(document.mainform.msel.options[document.mainform.msel.selectedIndex].value)" name="msel" class="select" style="width:150px;">

 

 

This means that when I continue and create the account it's created with the default settings, not the package I've selected. If I do it outside UBot the onchange event is triggered and the package is set.

 

Is there a way to do this?

 

 

 

Find the JavaScript function on the page, cut and paste it into a JavaScript node in UBot, and then call the function yourself. e.g

 

updateform(inVariable){

 

this is where the functions JavaScript code goes

}

 

/* Call the function */

 

updateform(someVariable);

Link to post
Share on other sites
  • 2 months later...

I may be going cross eyed, but I'm trying the same thing, to create an account in cpanel. I keep getting the "Account Creation Status: failed (Sorry, you must choose a plan)" I'm trying to fire the JavaScript with no luck.

 

I'm able to select the drop down and change it to a plan but that's it. After I change the plan I have a run JavaScript node with the following

 

function updateform(nfo) {
var selectEl = document.mainform.msel;
selectEl.className = selectEl.options[selectEl.selectedIndex].className;
   cpsets = nfo.split(",");
   // ip,cgi,quota,frontpage,cp,maxftp,maxsql,maxpop,maxlst,maxsub,plan,maxpark,maxaddon
   
   if (document.mainform.ip) {
       if (cpsets[0] == "n") {
           document.mainform.ip.checked = false;
       } else {
           document.mainform.ip.checked = true;
       }
       showDiv('ipselect','ipchkbox');
   }

   if (cpsets[1] == "n") {
       document.mainform.cgi.checked = false;
   } else {
       document.mainform.cgi.checked = true;
   }
   
   if (cpsets[3] == "n") {
       document.mainform.frontpage.checked = false;
   } else {
       document.mainform.frontpage.checked = true;
   }
   
   if (document.mainform.quota) {
       document.mainform.quota.value = cpsets[2];
   }
   if (document.mainform.maxftp) {
       document.mainform.maxftp.value = cpsets[5];
   }
   if (document.mainform.maxsql) {
       document.mainform.maxsql.value = cpsets[6];
   }
   if (document.mainform.maxpop) {
       document.mainform.maxpop.value = cpsets[7];
   }
   if (document.mainform.maxlst) {
       document.mainform.maxlst.value = cpsets[8];
   }
   if (document.mainform.maxsub) {
       document.mainform.maxsub.value = cpsets[9];
   }
   if (document.mainform.bwlimit) {
       document.mainform.bwlimit.value = cpsets[10];
   }
   if (document.mainform.hasshell) {
       if (cpsets[11] == "n") {
           document.mainform.hasshell.checked = false;
       } else {
           document.mainform.hasshell.checked = true;
       }
   }
   if (document.mainform.cpmod) { 
       for (var i = 0; i < document.mainform.cpmod.options.length; i++) {
           if (document.mainform.cpmod.options[i].value == cpsets[4]) {
               document.mainform.cpmod.selectedIndex=i;
           }
       }
   }
       document.mainform.plan.value = cpsets[cpsets.length-1];

   if (document.mainform.maxpark) {
       if (cpsets[12]) {
           document.mainform.maxpark.value = cpsets[12];
       } else {
           document.mainform.maxpark.value = 0;
       }
   }
   if (document.mainform.maxaddon) {
       if (cpsets[13]) {
           document.mainform.maxaddon.value = cpsets[13];
       } else {
           document.mainform.maxaddon.value = 0;
       }
   }
   if (document.mainform.featurelist) { 
       for (var i = 0; i < document.mainform.featurelist.options.length; i++) {
           if (document.mainform.featurelist.options[i].value == cpsets[14]) {
               document.mainform.featurelist.selectedIndex=i;
           }
       }
   }
   if (document.mainform.language) { 
       for (var i = 0; i < document.mainform.language.options.length; i++) {
           if (document.mainform.language.options[i].value == cpsets[15]) {
               document.mainform.language.selectedIndex=i;
           }
       }
   }

}

updateform(document.mainform.msel.options[document.mainform.msel.selectedIndex].value)

 

I'm creating a new account under a reseller account if that matters. Any suggestions would be great.

 

Thanks!

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...