OnClick increment or decrement value in input text for cart quantity value. here i'm going to help you in onclick increment value and decrement value, in input type cart quantity field. let see the code for on click increment and decrement.

HTML CODE
<div class="container">
<input type="button" onclick="decrementValue()" value="-" />
<input type="text" name="quantity" value="1" maxlength="2" max="10" size="1" id="number" />
<input type="button" onclick="incrementValue()" value="+" />
</div>
JAVA SCRIPT
<script type="text/javascript">
function incrementValue()
{
var value = parseInt(document.getElementById('number').value, 10);
value = isNaN(value) ? 0 : value;
if(value<10){
value++;
document.getElementById('number').value = value;
}
}
function decrementValue()
{
var value = parseInt(document.getElementById('number').value, 10);
value = isNaN(value) ? 0 : value;
if(value>1){
value--;
document.getElementById('number').value = value;
}
}
</script>
Here i have given some condition in if condition, if you don't want just remove that code. i hope this will be really helpful to you. thanks for visiting.. keep visiting for more tutorial.
Everything is skimmed left and the DIV's have flood covered up to clear the buoys. The marks are showcase square and message adjust right to get the network thing going. Pixel changes are made here and there to get things lining up right. I didn't invest much energy in this, so you might see some cross-program contrasts.
ReplyDeleteWriting a Blog or Article starts with the most critical component of all. The "Blog Post Title." If this is done correctly and keyword rich you can control 80% of the Organic Search engines traffic. Sending it to your website!
ReplyDeletehomework is good for students debate
Was wondering how to make this work with multiple forms on the same page? I tried and it only targets the qty field of the first form.
ReplyDeleteThanks for the great script.
The marks are showcase square and message adjust right to get the network thing going Send Flowers to Norway Cheap
ReplyDeleteI learn from a good blog, your blog I have a great inspiration, thank you. Pakistan Gifts online
ReplyDeleteSo luck to come across your excellent blog. Your blog brings me a great deal of fun.. Good luck with the site.
ReplyDeletemanabadi degree 1st semester results
Hello everyone, was interesting to read your article. Usually i'm reading New York Times , but now i will read you too!
ReplyDelete