Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2011 at 01:38 UTC
Updated:
22 May 2012 at 20:08 UTC
I have a form that has a text field and submit button. I want to be able to click the submit button and it opens a modal window with a form - this is all no problem. But I then want to be able to use the data from the text field from the form on the main page, how can I get this?
Any help would be greatly appreciated.
Comments
Comment #1
merlinofchaos commentedThis is fairly tricky. Generally, what you need to do is have your form submit process (server side) send back commands using ajax_command_replace() or similar to modify the existing page based upon the form submission. If your needs are complex, this can require writing custom commands to do precisely what you need, but I've found that most of the time, rendering what I need on the server and using replace/insert commands does the trick.
Comment #3
jordanmagnuson commentedI've got a related issue, but I think I'm wanting to pass data the other way around (from a standard drupal form into a modal when user submits the form: so the modal will say "Hi John" after the user submits the form where they enter their name). I've opened a separate issue at http://drupal.org/node/1556856 . Haven't had much luck getting any responses (it's been weeks), so if either of you have any insight, I'd be really grateful!