1

I have created a .js script that creates a popup box next when a button is clicked. This pop shows a lost of the different content types you can add from that popup. When you click on one of those links it will load the form elements through AJAX. That is all working great but there is a major problem.

The AJAX fields within the form that is loaded onto the the popup does not work itself, I can enter in some text but no AJAX is performed. The field type of the that field is an entity reference field.

Can anyone help me on this one please? Thank you in advance!

1

Maybe not the answer you're looking for, but things would probably work if you load the form page within a iframe. I've used this approach successfully with forms that have AJAX fields. In D7 the admin overlay is also built using iframes.

2
  • Hey thanks for the reply, will that iframe be easily themable? – N dube Mar 5 '12 at 17:36
  • @Ndube iframes show existing pages within another page so yes (you'll just have to theme the page you're showing in that iframe accordingly). – Madis Mar 5 '12 at 18:48
1

I solved the problem by loading the #content-inner div instead of for example the #example-content-type-node-form div. This seemed to allow me to use the ajax and easily theme the popup. Here is the line of code below within the AJAX function:

$('.popup-wrap .popup-form').html($(data).after('#content-inner'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.