Administrators Nathan Posted December 9, 2013 Administrators Share Posted December 9, 2013 The following code I'm having some issues with. I need to echo the variable "qtycheck" to see if it's getting populated correct as I suspect that's the issue.How can I echo it out on the page to see? <script type="text/javascript"> function check() { var elements = document.getElementsByName("quantity"); var qtycheck = document.getElementById("qtycheck").value; for (var i=0; i<elements.length; i++) { var nmbr = elements[i].value; if (nmbr > <?php echo $maxqtyorder; ?>){ alert("You've selected more treats than your package allows."); return false; } else if (nmbr > qtycheck){ alert("You've selected more treats than your package allows."); return false; } } return true; } </script> Quote Link to comment Share on other sites More sharing options...
Administrators Nathan Posted December 9, 2013 Author Administrators Share Posted December 9, 2013 Figured out by popping it into a dialog box. alert(qtycheck); The issue was the variable was not being populated, easy to see once I had it to see. 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.