You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

21. April 2010, 00:24:44

lsaplai

Posts: 836

Impossible to add resources on Gandi.net

Helle all,

Gandi (www.gandi.net) is a registrar and web host quite popular in Europe.
I have a server with them and one function that I'm supposed to be able to do is add resources (RAM, disk space...). Unfortunately, the functions they have to increment the quantity of resource to add and to submit the request, do not work in Opera 10.5 (Ubuntu 9.10 - using the few latest builds as well as 10.10)

These functions are under closed doors (login required) so I can't really paste a link here but here are the snippets of code used in the page source. I'm not sure it's sufficient to troubleshoot the issue but it must be a good starting point.

<form id="product_form" method="post" action=""><div class="box-fbox">      
<div class="bt"><div></div></div>      
<div class="i1">         
 <div class="i2">              


<div class="i3">                 
<div class="box-content">        
<p id="product_add">              
<label for="quantity">Number of GB<span>*</span></label>           
<input type="text" name="product_nb" id="quantity" class="in" size="10" value="1" />          
</p>          
<div class="sub">Please choose the number of GB you wish to add to your account.</div><span class="hrclear"></span></div>              
</div>          
</div>      
</div>      
<div class="bb"><div></div></div>  </div>          
<input type="hidden" name="do_post" value="1" />                  
<div class="button">                
<input  type="image"  src="/cgi/make_button.pl?type=submit_admin&label=Submit"  value="Submit" alt="Submit" /></div>                
<a  class="button" href="/admin/hosting/product/management/"><img class="gd-button" src="/cgi/make_button.pl?type=link_admin&label=Back" alt="Back" /></a></form></div><span class="hrclear"></span><span class="hrclear"></span></div>             
 </div>          </div>      </div>  


and this is what I figure is the relevant javascript:

        <
script type="text/javascript">  
//<![CDATA[  var CHECKER = {      
product_type: 'disk',            
quantity_el: null,      
form_el: null,            
modulo: null,      
max: null,      
quantity: 0,     
 old_quantity: 0,            
txt_alert_nan: "Please enter a number",      
txt_bad_value: "You have entered an invalid value",      
txt_min_value: "Minimum reached",      
txt_max_value: "Maximum reached",                  
init: function() {          
self = this;                    
/* Init */          
this.quantity_el = $('#quantity');          
this.form_el = $('#product_form');          
this.quantity = this.quantity_el.val();                    
if(this.is_product_memory()) {              
this.modulo =  256;              
this.max =  6144;              
this.old_quantity = 256;          
}          
else {             
 this.modulo = 1;              
this.max = -1;             
this.old_quantity = 1;         
 }                    

/* Add links */          
var container = $('#product_add');          
var add_link = $('<a href="#" id="add_btn">Add</a>');                    
container.append(add_link);          
add_link.css("padding", "0 0 0 10px");          
container.append(' | ');                
var remove_link = $('<a href="#" id="remove_btn">Remove</a>');          
container.append(remove_link);                
/* Bind links */          
$(add_link).click(function(e) {              
e.preventDefault();              
self.add_quantity();              
self.quantity_el.attr('value', self.quantity);              
self.quantity_el.focus();         
 });          
$(remove_link).click(function(e) {              
e.preventDefault();              
self.remove_quantity();              
self.quantity_el.attr('value', self.quantity);              
self.quantity_el.focus();          
});                    
/* Change quantity on blur */          
this.quantity_el.blur(function() {              
self.quantity = self.old_quantity = $(this).val();         
 });                    
/* Check quantity on submit */                  
this.form_el.submit(function(e, no_validation) {              
if(!no_validation) {                  
e.preventDefault();                                    
if(!self.check_quantity()) {                      
self.quantity_el.attr('value', self.old_quantity);                  
}                  
else {                      
self.form_el.trigger('submit', 1);                  }              }          });      },  


Of course, this works fin in Firefox... irked

Any help to figure out how to solve this will be appreciated.

Thanks
--
Laurent

Forums » Opera for Windows/Mac/Linux » Beta testing (including snapshots and previews)