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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:01:00+00:00 2026-06-12T17:01:00+00:00

I have two forms. One of which has two fields, the name field, and

  • 0

I have two forms. One of which has two fields, the name field, and a field called original_number. When the form POSTs, it leads to another form, and one thing I’d like to do is to store the name field, and the original_number field, as hidden values in the second form.

However, I’m not sure how to make it so that for the value field of the second form, rails receives the information from the POST method.

How would I make it so that for the value of the hidden field, the information that from the first form’s POST is used?

Here’s my first form

  <%= form_tag("/find_numbers", :method => "post", :id => "new_user" ) do %>
    <%= render 'shared/error_messages' %>    

    <%= label_tag(:name, "What Are You Tracking?") %>
     <%= text_field_tag(:name) %>

    <%= label_tag(:original_number, "Your Original Number") %>
    <%= text_field_tag(:original_number) %>
    <hr class="faded" />
    <h4>Choose One Of The Methods Below To Find Your Tracking Number</h4>
    <hr class="faded" />
    <%= label_tag(:in_postal_code, "Enter Your Postal Code (e.g. 94117):") %>
    <%= text_field_tag(:in_postal_code) %>

    <%= label_tag(:near_number, "Near this other number (e.g. 4156562345)") %>
    <%= text_field_tag(:near_number) %>

    <%= label_tag(:contains, "Matching this pattern (e.g. 415***EPIC):") %>
    <%= text_field_tag(:contains) %>  

    <%= submit_tag("Search", :class => "btn btn-large btn-primary") %>


  <% end %>

And here’s my second form, which receives information from the first form :

<%= @numbers.each do |number| %>

    <%= form_tag(:controller => "phones", :action => "create" ) do %>
        <%= hidden_field(:original_number) %>
        <%= hidden_field(:name) %>
        <%= hidden_field(:twilio_number, :value => number.phone_number) %>

        <div class="found_list">
            <div class="found_phone_number">
                <%= label_tag(:number, number.friendly_name) %>
            </div>
            <div class="choose_found_number">
             <%= submit_tag("Choose This Number", :class => "btn btn-large btn-success") %>
            </div>
        </div>
            <hr>
    <% end %>
<% end %>

Note the

        <%= hidden_field(:original_number) %>
        <%= hidden_field(:name) %>

Note the request parameters the first form sends,

    Request

Parameters:

{"utf8"=>"✓",
 "authenticity_token"=>"RMvjP9PQt9hVEJE449pMqgqnFcreqvXtmZFEyU+641g=",
 "name"=>"Stepan Parunashvili",
 "original_number"=>"1231231234",
 "in_postal_code"=>"",
 "near_number"=>"",
 "contains"=>"415"}

how would I get the “name”=>”Stepan Parunashvili”, to fill up the hidden field for :name, and the “original_number”=>”1231231234”, to fill up the field for the hidden field :original_number?

Thank you for bearing with me until now, any help would be greatly appreciated!

  • 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-12T17:01:01+00:00Added an answer on June 12, 2026 at 5:01 pm

    try this

              <%= hidden_field :original_number, params[:original_number] %>
              <%= hidden_field :name, params[:name] %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created two forms in my Windows Application. One Form acts as a
I have an object Project which has a number of fields, one of which
I have a two forms on a page. The first one has several quantity
I have a form which has multiple input fields, and 3 main options. depending
I have two forms on one page: a results form and a search form.
I have a Razor MVC3 project which has two user records in a form,
I have a class that has a number of fields, two of which are
I have two forms on one page and want to have the input boxes
I have two Forms. One with where all the main code is being executed.
I have two forms, one with a radio button that users must select to

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.