i am trying calculate the amount but having troble with jQuery .. can you guys please tell me whats wrong with my codes.
my Javascript and jQuery codes are:
i have change this as:
$(document).ready(function() {
$('.home_banner').cycle({
fx: 'fade'
});
$("#tabs").tabs();
});
and calculator codes as:
var u_rate = new Array();
u_rate[0] = new Array();
u_rate[0][0] = 1.022;
u_rate[0][1] = 0.75;
u_rate[1] = new Array();
u_rate[1][0] = 1.034;
u_rate[1][1] = 0.78;
calc();
function calc(){
var result = '';
var id = '';
id = 'u';
curr = u_rate;
var curin_id = jquery("#"+id+"currency_in").attr("selectedIndex");
var curout_id = jquery("#"+id+"currency_out").attr("selectedIndex");
var value_float = parseFloat(jquery("#"+id+"value").val());
if(value_float>0){
result=value_float*curr[curin_id][curout_id];
result=Math.round(result*100)/100;
}
jquery("#"+id+"result").val(result);
return true;
}
but still getting no response .. please check this and let me know
and the html is
please check on ukash2gold.com
please friends let me know how to resolve the issue ..
u will able to see the form under the tab of [Ukash to LR]
typeof jQueryyields"function"buttypeof $yields"undefined". Are you loading jQuery in noConflict mode?Edit 1
Yes you are; your slideshow code starts off like this:
See noConflict.
Edit 2
As far as I can tell, you’re not using any other framework that uses the
$variable. In that case, you can safely remove noConflict from your slideshow:If you’re using another framework somewhere else on the site, and need to stick to running jQuery in noConflict mode, you’ll have to modify your jQuery code to use
jQueryrather than the$shorthand.… etc.
Edit 3
Now you’re seeing the error
Uncaught TypeError: Cannot read property 'undefined' of undefinedat this line:What this means is, in your case, that
curin_idandcurout_idare both undefined. Therefore you’re trying to access a property'undefined'(curout_id) at the object'undefined'(curr[curin_id]which will yieldundefinedsincecurin_idis in itselfundefined).The cause for this is the following code:
selectedIndexis not an attribute of theselectbut a property of it. Although properties are native JavaScript constructions, you can read about them in the jQuery documentation.A simple fix in your case would be to change from
attr()toprop():Another solution would be to look at the index of the selected element, within its parent: