Ah, I see. I've added that and it displays the message. Thank you.
The Add to Cart button was generated by the eCart behaviour so if it hasn't got an ID then that's why! I've added id="LEDCart_1_ATC" to the Add to Cart button. How do I add code to hide it or show it? Is that built in to the updatePriceDisplay function?
In addition to this, I'm following the Inventory Management Product Detail tutorials - currently on http://www.webassist.com/tutorials/Inventory-management-product-detail-III. I've got as far as hiding the Add to Cart button if the stock level is zero however I'm running into problems with the onchange event again because I need the RemainingInventory figure to change as the user makes selections from the variable drop-downs.
The onchange event uses a separate recordset that Ray created called rsAddtoCartLookup which, as I understand it, checks the values from the drop-downs and displays the correct price and product code. Should I be trying to incorporate the RemainingInventory field into THAT recordset so that it updates depending on which product is returned when the user has made their drop down selection/s?
I had tried this...
<?php if ($row_rsAddToCartLookup['RemainingInventory'] > 0) { ?>
<input type="image" src="energy-saving-light-bulbs/btn-addbasketoff.png" class="addbasketbtn" value="Add to Cart" name="LEDCart_1_ATC" id="LEDCart_1_ATC" alt="Add to Basket" border="0"/>
<input type="hidden" name="LEDid" id="LEDid" value="<?php echo $_GET['lbid']; ?>" />
<?php } else { ?>
Out of Stock
<?php
}
?>
...but of course that doesn't work because the onchange event isn't a post.
Also, if there are only 5 products left in stock, how do I prevent a user from submitting a value more than 5 in the quantity field, prior to Add to Cart?
Hope you can help.
Thank you Jason
NJ


