Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6673225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:36:09+00:00 2026-05-26T03:36:09+00:00

I’m working on a prototype in Rails 3 and ended up using some jquery

  • 0

I’m working on a prototype in Rails 3 and ended up using some jquery (my first time and it’s pretty sweet). Although, it appears that I am stuck when submitting the data from my view, which is from the Impromptu JQuery Survey, and into a my database (sqllite3). Let me explain how the page works:

  • When a drop down item is selected the survey pops up. Also, this is a modal form and there’s about 7 questions.

That’s pretty much it. My desired outcome is after the user submits the form by clicking finish, each of the answered questions needs to do into the database. Some of the input fields are checkboxes and dropdowns.

Here is a sample of the code, from the last question of the survey:

state7: {
                    html:'Personality Type <div class="field"><select name="personality" id="rate_find"><option value="enfp">ENFP</option><option value="INTJ">INTJ</option><option value="ESTJ">ESTJ</option><option value="INTP">INTP</option></select></div>',
                    buttons: { Back: -1, Cancel: 0, Finish: 1 },
                    focus: 2,
                    submit: function(v, m, f){
                        if (v == 0) 
                            $.prompt.close()
                        else 
                            if (v == 1) 
                                return true; //we're done
                            else 
                                if (v = -1) 
                                    $.prompt.goToState('state6');//go back
                        return false;
                    }
                }
            }

            $.prompt(temp,{
                callback: function(v,m,f){
                    var str = "You can now process with this given information:<br />";
                    $.each(f,function(i,obj){
                        str += i + " - <em>" + obj + "</em><br />";
                    }); 
                    $.prompt(str)
                }
            });
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:36:10+00:00Added an answer on May 26, 2026 at 3:36 am

    The key/value pairs containing the information you got through the impromptu popup need to be piled into a POST request like you might expect in a regular form. If you have an ActiveRecord model for the data going into your database, then you could make a form in the view that has the dropdown that triggers the popup, but just make the whole form hidden. Then at the end of your survey you can go through and assign values to the correct input (e.g.

    $.each(f,function(i,obj){
         $('input#' + i).val(obj);
    });
    

    ), and the final ‘Finish’ button can trigger the submit event on the form. You can look at this question to find out how to check checkboxes with jquery.

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.