Drag &drop shopping list problem

Hi i have a drag and drop shopping list you drag an image with description and price into shopping basket and it adds the items to your shopping list.
but what i want to do is to be able to change the price then drag it to the shopping basket. i have tried to add a textfield where <p>Price:£0.33</input></p> is but it does not work any idea’s
here is the code i have.


 <p class="datagrid-row-selected">Fresh Produce
<ul class="products">
		  <a class="item">
				<img src="images/iconproducts/apple.png" width="50" height="50"/>

and here is the j query script

		var data = {"total":0,"rows":[]};
		var totalCost = 0;
					$(this).draggable('options').cursor = 'not-allowed';
					var name = $(source).find('p:eq(0)').html();
					var price = $(source).find('p:eq(1)').html();
					addProduct(name, parseFloat(price.split('£')[1]));
		function addProduct(name,price){
			function add(){
				for(var i=0; i<data.total; i++){
					var row = data.rows[i];
					if (row.name == name){
						row.quantity += 1;
				data.total += 1;
			totalCost += price;
			$('#cartcontent').datagrid('loadData', data);
			$('div.cart .total').html('Total: £'+totalCost);

Hi there,

I don’t know if it is a typo or not, but your mark-up is malformed.

It should be:

  <label for="price">Price:</label>
  <input id="price" type="text" />

Does that help?

If not could you maybe post a link to a page where we can see this problem?

Hi thanks for the reply here is the link so you can see what i am trying to do.

what i want to do is to be able to change the price then drag it accross to the shopping cart, and may be click a link to add another text feild.

Okay, well it looks like you have a more immediate problem.
When you drag one of the items to your cart, something is going wrong with the addition and the updated price is being displayed as “NaN” (Not A Number).

Could you make a simple demo page with just two items and the cart area (to drag the items onto) and we can work from there.

if you just drag the apple it will work, the others wont work because i have’t changed the $ to a £ thats why,
i need to be able to change the price before i drag into the cart or after, any idea’s.

Just tried that, unfortunately the apples don’t work either.

It would help if you could make a simple demo page that we could use as a basis for this (it just cuts out the amount of unrelated code one has to look at).