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 8181095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:24:21+00:00 2026-06-07T00:24:21+00:00

Im attempting to style this plugin into my rails 3.2 app and having some

  • 0

Im attempting to style this plugin into my rails 3.2 app and having some problems.. http://www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery.aspx

The form is not saving to my model when i click submit, just redirects to the first step. …

Heres my view code:

     <h1>Tell us a little about yourself.</h1>


    <form id="SignupForm" action="">
    <fieldset>
    <legend>Personal Information</legend>
    <%= simple_form_for @user do |f| %>

      <%= f.input :city %>
      <%= f.input :address %>
      <%= f.input :zipcode %>
      <%= f.input :date_of_birth, :as => :date, :start_year => Date.today.year - 90,
        :end_year => Date.today.year - 12,
        :order => [:month, :day, :year ] %>
      <%= f.input :gender, :collection => ['male','female'] %>
      </fieldset>

      <fieldset>
      <legend>Interests & Holidays</legend>
      <h2>Select your top 3 interests..</h2>
      <label class="checkbox">


      <%= f.association :interests, :as => :check_boxes, :label => false %>
      </label>
      <br></br>
      <h2>What holidays do you celebrate?</h2>
        <label class="checkbox">
        <%= f.association :holidays, :as => :check_boxes, :label => false %>

        </label>
        <br></br>
        </fieldset>
        <fieldset>
        <legend>Friends Birthdays</legend>
        <h2>Add up to 10 friends birthdays that you would like to remember..</h2>
        <br></br>
        <%= f.simple_fields_for :friends do |friend_f| %>
          <div id="input1" style="margin-bottom:4px;" class="clonedInput">
          <%= friend_f.input :name %>
          <%= friend_f.input :dob, :label => :Birthday, :as => :date, :start_year => Date.today.year - 90,
            :end_year => Date.today.year - 12,
            :order => [:month, :day, :year ] %>
          <%= f.input :gender, :collection => ['male','female'] %>

          <input type="button" id="btnAdd" value="add another name" />
          <input type="button" id="btnDel" value="remove name" />
          </div>
        <% end %>


        <%= f.button :submit %>
        <%end%>
        </fieldset>
    </div>

And heres the js:

(function($) {
    $.fn.formToWizard = function(options) {
        options = $.extend({  
            submitButton: "" 
        }, options); 

        var element = this;

        var steps = $(element).find("fieldset");
        var count = steps.size();
        var submmitButtonName = "#" + options.submitButton;
        $(submmitButtonName).hide();

        // 2
        $(element).before("<ul id='steps'></ul>");

        steps.each(function(i) {
            $(this).wrap("<div id='step" + i + "'></div>");
            $(this).append("<p id='step" + i + "commands'></p>");

            // 2
            var name = $(this).find("legend").html();
            $("#steps").append("<li id='stepDesc" + i + "'>Step " + (i + 1) + "<span>" + name + "</span></li>");

            if (i == 0) {
                createNextButton(i);
                selectStep(i);
            }
            else if (i == count - 1) {
                $("#step" + i).hide();
                createPrevButton(i);
            }
            else {
                $("#step" + i).hide();
                createPrevButton(i);
                createNextButton(i);
            }
        });

        function createPrevButton(i) {
            var stepName = "step" + i;
            $("#" + stepName + "commands").append("<a href='#' id='" + stepName + "Prev' class='prev'>< Back</a>");

            $("#" + stepName + "Prev").bind("click", function(e) {
                $("#" + stepName).hide();
                $("#step" + (i - 1)).show();
                $(submmitButtonName).hide();
                selectStep(i - 1);
            });
        }

        function createNextButton(i) {
            var stepName = "step" + i;
            $("#" + stepName + "commands").append("<a href='#' id='" + stepName + "Next' class='next'>Next ></a>");

            $("#" + stepName + "Next").bind("click", function(e) {
                $("#" + stepName).hide();
                $("#step" + (i + 1)).show();
                if (i + 2 == count)
                    $(submmitButtonName).show();
                selectStep(i + 1);
            });
        }

        function selectStep(i) {
            $("#steps li").removeClass("current");
            $("#stepDesc" + i).addClass("current");
        }

    }
})(jQuery); 
  • 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-06-07T00:24:23+00:00Added an answer on June 7, 2026 at 12:24 am

    Here is how I solved the problem. I first edited the options in the formToWizard.js file like so:

    .options = $.extend({ submitButton: “submit” }

    Then in my view I changed the form element as shown below:

    <script type="javascripts" src="formToWizard.js"></script>
      <form id="SignupForm" action= "users#create" method="post">
        <%= simple_form_for @user do |f| %>
         <fieldset><div id='step'>
    
           #multiple input fields
    
         <%= f.submit "Create my account", class: "btn btn-large btn-primary" %>
       <% end %>
      </div></fieldset>
    </form>
    

    I used this to sign up users so I made sure to point the form element to my users#create path and then I used the method “post”. If you are unsure about which route to use in order to get to your create action in your controller just run rake routes and use that to fill in the “action” and “method” fields for the form and you should be good to go!

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

Sidebar

Related Questions

I'm attempting to style the ActionBar, following this blog post: http://android-developers.blogspot.com/2011/04/customizing-action-bar.html With this source
I am currently having problems with attempting to style the HTML rich text editor
After attempting to switch my Rails app to thin server using these instructions ,
I'm using Tim Heuer's style to get an editable combo box from here: http://timheuer.com/blog/archive/2008/11/05/silverlight-editable-combobox-using-styles.aspx
I'm attempting to use the flowplayer gem in my Rails 3 app. I've followed
I'm attempting to parse some Wiki-style markup using the Javascript Creole Wiki Markup Parser
I'm attempting to connect to an existing Comet-style long-poll service using an AIR app.
I'm attempting to setup logging in my simple classic-style sinatra app. (v1.3.2) I define
I am attempting to style a page and its very close but I am
I'm attempting to change the style of a button using the :checked and :unchecked

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.