radar Posted August 23, 2010 Share Posted August 23, 2010 if(document.getElementById('order_amount').value >= document.getElementById('cpc').value) { document.getElementById('order_amount').value = document.getElementById('cpc').value; } this works, up until 99 as soon as you type 100 into the order ammount, it doesn't recognize 100 being greater than or equal to 30 any idea's as to why? the 2 form fields for this look like: <input id="order_amount" maxlength="3" name="order_amount" size="3" type="text" value="1" onchange="calPrice('{$data.sale_price}');" /> <input name="cpc" type="hidden" id="cpc" value="{$data.qty_pc}"> Quote Link to comment Share on other sites More sharing options...
radar Posted August 23, 2010 Author Share Posted August 23, 2010 parseInt is your friend! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.