refiking Posted July 15, 2011 Share Posted July 15, 2011 Should I try to split this up into a new function or something? I'm lost. When I go through the process and select zip code, it prompts me to enter my zip code, but I can't click continue. If I need to make it a new function, can you show me how and where I should implement it? <script type="text/javascript"> function findstore(){ var txt = 'Step 1: Select your store by:<br><input type="radio" name="type" value="dropdown"> Dropdown Menu<br><input type="radio" name="type" value="zipcode"> Zip Code Search'; $.prompt(txt,{ buttons:{'Confirm':true, 'Cancel':false}, submit: function(v,m,f){ var flag = true; if (v) { } return flag; }, callback: function(v,m,f){ if(v){ if(f.type == 'dropdown'){ document.getElementById('demo').innerHTML = '<table align="center"><tr><td><img src="images/ajax-loader.gif"></td></tr></table>'; var type = f.type; $.post('findstore.php',{type:type}, function(data){ $("div#demo").html(data); } ); } if(f.type == 'zipcode'){ var txt = 'Step 2: Enter your zipcode: <input type="text" name="zip"'; $.prompt(txt,{ buttons:{'Confirm':true, 'Cancel':false}, submit: function(v,m,f){ var flag = true; if (v) { } return flag; }, callback: function(v,m,f){ if(v){ $.post('findstore.php',{type:'zipcode',zip:c.zipcode}, function(data){ $("div#demo").html(data); } ); } } }); } } } }); } </script> Quote Link to comment https://forums.phpfreaks.com/topic/242028-multiple-prompts-within-the-same-function/ 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.