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

  • Home
  • SEARCH
  • 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 3759372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:18:23+00:00 2026-05-19T10:18:23+00:00

I have a multi-page form with many dropdown select boxes. Most of those boxes

  • 0

I have a multi-page form with many dropdown select boxes. Most of those boxes need to have an “Other” field and then a way to enter content that is not one of the select values. When the form is submitted, if “Other” is selected, the “other” content should be saved into the database in place of the dropdown menu.

Is there a plugin or script that has already been written that can do this for me easily? A lot of my fields are created dynamically and must be edited later on (using a nested form jquery plugin) so writing code that applies to all of them (without writing a specific function for each field) has been tough for me.

If I can’t find a suitable plugin I will probably use the Dojo dijit Combobox, and while that accomplishes exactly what I am looking for, the ideal for my users would be a select box plugin that has an “Other” option in the dropdown, and when “Other” is selected a text box would appear for users to fill out. When the field is being edited, it would also need to populate the dropdown or text-box appropriately based on the value stored in the database. Does something like this exist, either in javascript/jquery/prototype/other, or a rails 3 plugin or gem? Thanks so much!

Edit: I will most likely use FlexBox if I can’t find something with a separate text area – but I’m still looking for a separate-text-area solution!

  • 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-19T10:18:24+00:00Added an answer on May 19, 2026 at 10:18 am

    I’ve thrown together a small script which might do what you want: http://jsfiddle.net/nHh3C/
    Could definitely still be improved, but I guess you get the idea. Might actually use this myself 😀

    Here’s the JS:

    $('select').each(function(i, select){
        if (!$(select).data('name')) {
            $(select).data('name', $(select).attr('name'));
        } 
        $(select).change(function(){
            if ($(this).val() == 'other') {
                $('<input/>', {
                    'name' : $(this).attr('name')
                }).insertAfter($(this)); 
                $(this).attr('name', '');
            } else {
                $('input[name='+$(this).data('name')+']').remove();
                $(this).attr('name', $(this).data('name'));
            }
        });
    });
    

    EDIT
    Ah, and incase this wasn’t clear — it uses jQuery. Just change the select selector to what you need and you should be set. Wouldn’t be hard to wrap this in a plugin either.

    EDIT 2
    With rails you should be probably able to do something like this (probably nicer in a helper) to generate the select:

    select("post", "person_id", Person.all.collect {|p| [ p.name, p.id ] } << ['Other', 'other'])
    

    For the edit view you could then just check if the value is contained in the select values and if not, print an additional input field and set the select to pre–select the ‘other’ options. And you should handle the JS to match the situation.

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

Sidebar

Related Questions

I have a multi-lingual page where I want to display form validation error in
I have a multi-step form and user can navigate to any page to modify
I have a multi-table query, similar to this (simplified version) SELECT columns, count(table2.rev_id) As
I have a three-level multi-nested form in Rails. The setup is like this: Projects
Im trying to add a multi page form, in php with zend framework, where
Supposing I had a multi-form page such as: <form id=A class=jaxy ... /> <form
I have decided to use ASP.NET MVC to develop multi page (registration) forms in
I have a web page with 2 listboxes (HTML select control). The first listbox
I have a login.jsp page which contains a login form. Once logged in the
I have a multi-step form, let's say for the sake of ease it's 2

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.