Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: open
I am not sure what Magento does in this regard; do feel free to post back your results.
<form method="POST" action="addtocart">
<input type="text" name="quantity" value="1">
<input type="hidden" name="product" value="widget">
The function 'validation()' should return 'true' on success; and 'false' on failure (along with visual feedback about the problem).