PHP Help

mere2180

Newbie
Joined
Jan 26, 2011
Messages
18
Reaction score
129
Wasn't sure where this was spossed to go, but this is the code for shopperpress. Whenever I goto add a product, I click on it and i get the javascript void error. I went ahead and pulled up the code and this is where I am stuck. It won't let me add any products. What could be wrong?

Code:
   <p>[<a href='javascript:void(0);' onClick="addProduct('<?php echo $cats; ?>','<?php echo $_POST['amazon']['country']; ?>','<?php echo $data['asin']; ?>');">add product</a>] - [ <a href="<?php echo $data['url']; ?>" target="_blank">View Item</a> ]</p>
 
Last edited:
Post your PHP code, including the form sending that POST request.
 
Information is too limited. Get Firebug if you're using Firefox, or even just look at the Firefox error log. It'll specify what's throwing the error.
 
Try this perhaps:
HTML:
   <p>[<a href='#' onClick="return (addProduct('<?php echo $cats; ?>','<?php echo $_POST['amazon']['country']; ?>','<?php echo $data['asin']; ?>') && false);">add product</a>] - [ <a href="<?php echo $data['url']; ?>" target="_blank">View Item</a> ]</p>
You should not use inline scripting by the way (onClick=) , try using jQuery to bind events to those HTML elements.
 
Last edited:
Back
Top