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}"> Link to comment https://forums.phpfreaks.com/topic/211518-noob-i-know-but-having-greather-than-issues/ Share on other sites More sharing options...
radar Posted August 23, 2010 Author Share Posted August 23, 2010 parseInt is your friend! Link to comment https://forums.phpfreaks.com/topic/211518-noob-i-know-but-having-greather-than-issues/#findComment-1102761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.