Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert Storing values in database fro...

Replytotopic

Storing values in database from popupwindow form

Posted in Forums : Ask a Rails expert

 
Profile

Authority 25
Posting Rating 0
Sign in to rate this post

Hai I generated popup window using

<= link_to ‘Contact Cloudien’, { :controller => ‘user’, :action => ‘contact_cloud’ }, { :popup => [‘new_window’, ‘height=500,width=500’] }>

In the popup window i have form with feilds(name…etc).when i submit the form it completes the javascript form validations but those values are not saving in database.

This is form tag:
<form name="contact" action="/user/contacts" method="post" onsubmit="return contact_cloudien();" id="contact">

here control not passing to contacts def in usercontrolleronly showing contacts.rhtml.
please tell me how to send control to controller and how to save values in database.

 
Profile

Authority 25
Posting Rating 0
Sign in to rate this post

Its’s working .i put the javascript close link to close the window but i need to close the popup window automatically after submitting the form( without any user interface)
please me suggestions

 
Me_on_a_train

Authority 87
Posting Rating 84
Sign in to rate this post

You can trigger the form close when the AJAX request completes. See here for an example in Prototype: https://gist.github.com/5e44a2aa8b627a74389b

 
Mahesh_new_image

Authority 37
Posting Rating 95
Sign in to rate this post

Pat,

can you explain it clearly how can i do this. i an unable to get from your post.

Thank You,
Uma.

 
Me_on_a_train

Authority 87
Posting Rating 84
Sign in to rate this post

Take another look at the gist. I’ve updated it with comments to explain, step by step what’s going on.

 
Profile

Authority 25
Posting Rating 0
Sign in to rate this post

Thank You Pat Nakajima.But i have changed my code from popupwindow to modalbox.Thanks for helping me.
Is any chance to display multiple modalboxes in single page?

Replytotopic

Other Recent Topics

Ask a Rails expert : How to implement SSL in development environment that runs on mongrel?

Ask a Rails expert : tinymce changes url

Ask a Rails expert : Advanced searching

Ask a Rails expert : Is Rails HMVC ?

Ask a Rails expert : How to integrate paypall in RAILS App?

Ask a Rails expert : Paperclip get param data in update action

Ask a Rails expert : Using ruby's activerecord in C#/.NET

Ask a Rails expert : Showing status of current request by AJAX

Ask a Rails expert : Showing status of current request by AJAX

Ask a Rails expert : How to run exe file in ruby?

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel