lastkarrde Posted April 4, 2011 Share Posted April 4, 2011 Howdy folks. I'm having some troubles with forms not submitting when they are included by an AJAX call. I have a page, <em>/add_many/</em> which just displays an HTML form. If I navigate to that page the form works as expected. However If i try and display that page in a dijit.Dialog modal (loaded via AJAX), the form will not submit. Below is my AJAX code addDialog = new dijit.Dialog({title: 'Add Reddit User', style: 'width:500px', preventCache:true}); addDialog.attr('href', '/add_many/'); addDialog.show(); The form displays fine in the dijit.Dialog box, and I can enter information into it. However clicking the submit button does absolutely nothing. Any ideas? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/232633-why-doesnt-this-form-submit/ Share on other sites More sharing options...
Adam Posted April 4, 2011 Share Posted April 4, 2011 I'm not at all familiar with Dijit or Dojo, but the documentation suggests that you need to handle the form in a different way: In order to run Dialog's execute-method the submit button has to be a dijit.form.Button, normal submit button doesn't trigger this function. http://dojotoolkit.org/reference-guide/dijit/Dialog.html#forms-and-functionality-in-dialogs Quote Link to comment https://forums.phpfreaks.com/topic/232633-why-doesnt-this-form-submit/#findComment-1196574 Share on other sites More sharing options...
lastkarrde Posted April 5, 2011 Author Share Posted April 5, 2011 Thanks. I added dojoType="dijit.form.Button" to my submit button and It seems to fix it. I find it crazy that Dojo hijacks the event by default though :S . Quote Link to comment https://forums.phpfreaks.com/topic/232633-why-doesnt-this-form-submit/#findComment-1197051 Share on other sites More sharing options...
Adam Posted April 5, 2011 Share Posted April 5, 2011 Yeah... Personally based on just that, I don't think I'll be using it any time soon. Quote Link to comment https://forums.phpfreaks.com/topic/232633-why-doesnt-this-form-submit/#findComment-1197071 Share on other sites More sharing options...
lastkarrde Posted April 5, 2011 Author Share Posted April 5, 2011 Ah crap. It doesn't work. It just closes the Dialog, no data gets submitted... Quote Link to comment https://forums.phpfreaks.com/topic/232633-why-doesnt-this-form-submit/#findComment-1197101 Share on other sites More sharing options...
Adam Posted April 5, 2011 Share Posted April 5, 2011 Do you have this online that we could look at? Or if you don't want it public could you PM me the URL? As I said I don't really have any experience working with Dojo, so random guesses one at a time to try and fix it could take a while. Quote Link to comment https://forums.phpfreaks.com/topic/232633-why-doesnt-this-form-submit/#findComment-1197106 Share on other sites More sharing options...
lastkarrde Posted April 6, 2011 Author Share Posted April 6, 2011 Code is on a local dev setup, it would take too much work to make it public facing. I ended up ditching the AJAX and including the page with an iframe in the dialog. Not the best solution.. but it works. Quote Link to comment https://forums.phpfreaks.com/topic/232633-why-doesnt-this-form-submit/#findComment-1197586 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.