hi was wondering if this works with forms from other pages. say webform? right now im trying to implement this for the send to a friend module which is just a form page. just wondering if it would load up form data?

thanks

Comments

drclaw’s picture

It works quite well with webforms. It should work with any form though. The only thing that is a little tricky is if the form you're loading has any AJAX powered elements. It doesn't load the javascript from the target page.

When I use this module for webforms, I just use the ID of the webform form element. Something like this:

<a href="/my-webform" class="simple-dialog" name="webform-client-form-562" title="My Webform Title" rel="width:900;position:[center,60];">Link TItle</a>
bryancasler’s picture

subscribe

patoshi’s picture

thanks works wonders!!! you juts saved me hours of having to figure out how to do it with a custom script. but i should learn it anways.

drclaw’s picture

Status: Active » Fixed

Glad to hear it's working. Maybe take a look at the simple_dialog.js file to learn how to do it with a custom script. =)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lock2007’s picture

Ho can I validate my form in the same modal window ? when I click validate, it closes !
Any help ?

drclaw’s picture

Right now this module doesn't handle validation or confirmation pages within the modal. It's really just good for simple forms with no validation... I'm working on it though!

sharadhake’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Status: Closed (fixed) » Needs work

Hi,
Simple dialogue works great for me. But How can I validate my form in the same modal window ?
Thanks in adavance.

drclaw’s picture

Status: Needs work » Closed (fixed)

Form validation works on page reloads so the modal disappears when the form is submitted. To get the validation (and submission) to happen "within" the modal, I need to either use an iframe (boo) or use something like ctools to AJAX-ify the form. There is an open ticket for this (#1241242: Webform confirmation URL to display in Simple Dialog modal window) but I may not have time to work on it for a while. =(

Unfortunately for now, the only way to get some validation on forms within simple dialog modals is to use javascript validation which you'll have to write yourself.

sandipmakwana’s picture

its works great. but one big problem. validation not working over Dialog window.
What to do ? please give any solution.

Thanks

drclaw’s picture

You need to use client-side (javascript) validation to make it work. Maybe this could help: http://drupal.org/project/clientside_validation?

stevegmag’s picture

This worked great, except I can't type in my text fields. Any ideas?

Would be great to have a callback added to the options...
found this to get some post modal form load to call some js, but nothing I do lets me type in the text field:

(function ($) {
   Drupal.behaviors.handleUpdateForm = {
    attach: function(context, settings) {
    // Modal form javascript goes here
    }
  };
})(jQuery);
cocoonfx’s picture

My webform doesn't work within the dialogue box and the dialogue boxes has changed the styling slightly. Any ideas on how to get the form to work?

Contact Us

drclaw’s picture

Hello,

You need to wrap your html in <code> tags so that it won't be rendered by the browser. Try removing the "#" from your name attribute:

<a href="contact-us" class="simple-dialog" rel="[center,60]" name="webform-client-form-17" title="Contact Us" id="my-id">Contact Us</a>
langelhc’s picture

I get validation and confirmation work in the popup with this sandbox module: http://drupal.org/sandbox/alex.designworks/1446550
Here is the full thread http://drupal.org/node/1211320

Bytes!

shamoona’s picture

How can i set the 'name' attrib? becuase my < a> is of widget "Link" and it is automatically generating the 'name' attrib. i couldnot find the option to set it by myself. Help plz.

drclaw’s picture

I don't follow. Are you talking about a link field by the link module?

shamoona’s picture

Yes, I am talking about link field of link module.

To popup the modal you suggested the statement above:

< a href="/my-webform" class="simple-dialog" name="webform-client-form-562" title="My Webform Title" rel="width:900;position:[center,60];">Link TItle< / a>

for this to achieve, i need to set the "name" to my webform-id but when i use link module to create < a> field in my content type, i cannot set the 'name' mannually like i can set the 'URL' and 'rel'. How can i set the 'name' by myself (it is generating automatically by the Link Module).

drclaw’s picture

Hm. Well I suppose you would have to theme the link output somehow in your theme. I'm not sure exactly which theme function you would need to override but I'm sure the link module has one where you can alter the link output.

mickadoo’s picture

The dialogue appears (empty) but I get an error in the console when using this.

jquery.min.js?v=1.8.3:2 Uncaught TypeError: d.widget is not a function
    at eval (eval at <anonymous> (jquery.min.js?v=1.8.3:2), <anonymous>:7:16)
    at eval (eval at <anonymous> (jquery.min.js?v=1.8.3:2), <anonymous>:7:2169)
    at eval (<anonymous>)
    at jquery.min.js?v=1.8.3:2
    at Function.globalEval (jquery.min.js?v=1.8.3:2)
    at text script (jquery.min.js?v=1.8.3:2)
    at On (jquery.min.js?v=1.8.3:2)
    at T (jquery.min.js?v=1.8.3:2)
    at r (jquery.min.js?v=1.8.3:2)
    at Object.send (jquery.min.js?v=1.8.3:2)

The steps I followed were

  1. Create a webform from /admin/content
  2. Add a link from a different page to the webform (I added a URL to the webform, and also tried with just /node//view
  3. Click on the new link

This is what my link looks like

    <a href="/node/37/view"
       class="simple-dialog"
       name="webform-client-form-37"
       title="My Webform Title"
       rel="width:900;position:[center,60];">
      Link TItle
    </a>

I can see in the network panel that the page is being fetched, but it's never displayed in the dialog. The page that's being fetched is not just the form, but includes the top menu and footer, as if it was being displayed in a standalone page. Perhaps this could be another symptom of what I'm doing wrong.