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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:13:20+00:00 2026-06-03T04:13:20+00:00

My simple_forms are showing validation messages before the form is even submitted. For example,

  • 0

My simple_forms are showing validation messages before the form is even submitted.

For example, right when you land on the signup page, it’s as if you just tried submitting an empty form- the first_name and last_name fields are highlighted in red, with the can't be blank error messages next to them.

Adding:

required => true

(or false) on the simple_form has no effect.

I have validations in my user model. If I remove those model validations, the forms work as expected (adding required: true gives me properly-functioning client-side validation). However, I want to have both client-side and model validations.

Does anybody have a clue as to why validations are triggered when the form is first loaded?

I’m using simple_form 2.0.1 with bootstrap-sass 2.0.1 in my Rails 3.2.2 app. My user form uses the bootstrap styling ('form-horizontal'), although when I remove that it still validates prematurely. Also, adding :novalidate => true to the form builder has no effect.

Thanks!

Edit: here is the new action is my doctors_controller:

def new
    @doctor = Doctor.new
    @user = @doctor.build_user
end

(User is a polymorphic association and can belong to multiple models.)

It seems like the user model is getting saved even though I’m using build_user rather than create_user.

Solved

I updated my model validations to include on: save, which solved the problem. It was validating the not-yet-saved user object.

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

    I updated my model validations to include on: save, which solved the problem. It was validating the not-yet-saved user object.

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

Sidebar

Related Questions

I have a simple form showing products from my database. Each product has a
I'd like to handle a simple web form from my application without showing the
I have a problem with simple form for, I get this error url(http://localhost:3000/konkurrencer/new): Showing
In my asp.net webform page I have a simple form with a single inputfield
Right I'm learning how to do a simple image upload form to upload an
I have a simple form in my page as shown in the pic. Is
I m building a very simple form validation which validates only required fields. This
I'm processing a form with php and I want to add validation on the
So I have a form with both javascript validation to check each field is
I have an ASP.NET MVC 2 form that is working perfectly, doing client side

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.