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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:57:01+00:00 2026-05-18T00:57:01+00:00

I basically want to prevent searches that are less than 3 characters long. In

  • 0

I basically want to prevent searches that are less than 3 characters long.

In Rails 2.x, I would just do this in an onClick event. I understand how to handle AJAX requests and responses in Rails 3 now, but wouldn’t using the onClick event be considered obtrusive in Rails 3?

  • 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-18T00:57:01+00:00Added an answer on May 18, 2026 at 12:57 am

    Got it!
    I put this code in application.js:

    // Place your application-specific JavaScript functions and classes here
    // This file is automatically included by javascript_include_tag :defaults
    $(function() {
        $("#search_submit").click(function() {
            if ($("#search_value").val().length < 3) {
                alert("You must supply 3 or more characters in your search.");
                return false;
            }
        })
    })
    

    My form is:

      <%= form_for(@search, { :remote => true, :html => { :id => 'left', :class => "custom-border" } }) do |f| %>
        <h2><%= f.label :value, "Search By Part or Interchange #" %></h2>
        <p><%= f.text_field :value %></p>
        <p class="button"><%= f.submit "Search" %></p>
      <% end %>
    

    Voilá!

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

Sidebar

Related Questions

I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not
I basically want to make things easier by just looping LinkButtons instead of making
I basically want to open a browser window from Word using VBA that does
I just basically want to add about 20 and sometimes 80 Proximity Alerts with
I want to prevent line breaks between two forms I have. So basically: <form
I've been working on this jsFiddle as an example of what I want. Basically
OK, I've checked this thread: Prevent click event in jQuery triggering multiple times and
Basically, I want an infinite size (more accurately, hard-drive rather than memory bound) dict
Basically I'm just looking for a 'SelectedItemTemplate' in the SL3 ComboBox. Unfortunately, that doesn't
Let me describe the thing that I want to accomplish: I basically want 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.