Scropion Posted July 13, 2009 Share Posted July 13, 2009 Hey I am coding a marketplace and I am using jQuery to togglePages and when I submit on a togglePage it always sends me to the starting page without submitting. Any help on this?? <script type="text/javascript"> function togglePage(page) { $("#contentField").load("includes/" + page + ".php"); } </script> <div id="contentField"> <form method='POST' style='margin:1px'><select name='quantity' style='font-size:10px; font=face: verdana'> Quote Link to comment Share on other sites More sharing options...
Scropion Posted July 14, 2009 Author Share Posted July 14, 2009 I've tried adding the page to the base but I still doesn't submit. Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted July 15, 2009 Share Posted July 15, 2009 Where is the rest of your html form? It seems to be cut off. And when the togglePage function is being called? Quote Link to comment Share on other sites More sharing options...
Scropion Posted July 16, 2009 Author Share Posted July 16, 2009 <select name='quantity' style='font-size:10px; font=face: verdana'><option value='0'>0</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option></select><input type="hidden" name="purchase_item" value="Old"><br><br><input type="submit" name="purchase" value="Buy!"></form> Thats it Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted July 16, 2009 Share Posted July 16, 2009 A couple of line breaks would have been nice. In your code I do not see any onchange even for the select element. you can add the even like so: <script> $(document).ready(function(){ console.log('ready'); $("select:[name='quantity']").change(function(){ alert(this.value); }); }); </script> You should be able to finish the rest of the code to get it working. 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.