Reply
Thu 10 Jan, 2013 01:12 am
Hello, i am writing some javascript for a website and have stumbled across a problem.
I have this section of code:
Javascript File:
.bind('drop', function (evt) {
var id = evt.dataTransfer.getData('text'),
item = $('#' + id),
cartList = $("#cart ul"),
total = $("#total span"),
price = $('p:eq(1) span', item).text(),
prevCartItem = null,
notInCart = (function () {
var lis = $('li', cartList),
len = lis.length,
i;
PHP Page:
echo " <input type=\"radio\" name=\"credit_used\" value=\"currency1\" onclick=\"set_credit();\" >currency1<br>";
echo " <input type=\"radio\" name=\"credit_used\" value=\"currency2\" onclick=\"set_credit();\">currency2";
I want to make it so that when a user clicks on currency 1, this line:
price = $('p:eq(1) span', item).text(),
stays as it is, but if they select currency 2. the line becomes
price = $('p:eq(2) span', item).text(),
How would i go about this? i have tryed using a function and also if/else statements.
Many thanks
Ryan
Hello all,
Thanks for your great posting this is really nice. I have used your java script coding.
Very appreciated one so please keep posting like this.
Thanks a lot
Duncan Jones