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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:05:14+00:00 2026-06-13T04:05:14+00:00

In my form, I used the span tag like the following: <%= content_tag :span,

  • 0

In my form, I used the span tag like the following:

<%= content_tag :span, f.object.User, class: 'username' %>

It looks like the following in HTML after i selected the value:

<span class="user" style="">Antony</span>

The problem is id doesn’t get the value to the database when we create a form. I don’t know the exact problem is. I want to use this content tag instead of text_field to get the value.

Thanks.

  • 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-13T04:05:15+00:00Added an answer on June 13, 2026 at 4:05 am

    When you submit an HTML form, the only values that get POSTed are those that are in input fields such as text fields, selects, checkboxes, buttons, etc. Content that is simply on the page — in a span or not — will not get posted back to the server. That isn’t a Rails issue, it’s just the way HTML works.

    I’m not exactly sure what you’re trying to do here, but a common approach when you want to display a value (not in an input box) and also post the value back with the form, is to both render the value on the page (in a span or however you want) and also add a hidden input field (hidden_field_tag) that also has the value in it.

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

Sidebar

Related Questions

When label tag should be used over span or dev in form? Example: option1-span:
My html form has optional items to display as follows: <span class=Optional Command1 Command2>
My HTML is of the form: <ul> <li class=tile> <span class=hidden></span> <span class=hidden></span> </li>
I have a simple field form <div class=field fade-label> @Html.LabelFor(model => model.Register.UserName) @Html.TextBoxFor(model =>
I come across this: html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,d l,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,figure,footer,header,hgroup,menu,nav,section,menu,time,mark,audio,video{background:transparent;border:0;font-size:100%;list-style:none;margin:0;padding:0;outline:0;vertical-align:baseline;} The comment mention reset, I guess is used
I have the following form which is being used to create new records <?php
I have an HTML string that has the following form: <tr valign=top><td colspan=2 style=padding-bottom:5px;text-align:
Here is the form to have ajax check out user existence. <!DOCTYPE html> <html>
I have a registration form and used fieldset to order the input fields in
Once I have programmed GUI with Java and have used Form Layouts. Form layout

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.