Welcome Guest, Not a member yet? Register   Sign In
How to send some data to a function without loading a new page
#1

[eluser]ethio[/eluser]
I'm trying to send a product id to a method without loading a new page, and since I do not have a sentence in the method to load another view I get a blank page.

This is the from inside the product view
Code:
echo form_open('shopping_basket/add_to_basket/');
echo form_hidden('pid', $id);
echo form_submit('add', 'Add to Basket');
echo form_close();

I have also tried using JavaScript which also loads a blank page
Code:
echo "<a href=''  return false;'>Add to Basket</a>";

function addBasket(id)
{
[removed].href = 'http://localhost/CI/index.php/shopping_basket/add_to_basket/' + id;
return false;
}


Messages In This Thread
How to send some data to a function without loading a new page - by El Forum - 06-03-2013, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB