Displaying 20 results from an estimated 1000 matches similar to: "pass values with autocomplete textfield"
2006 Jun 18
3
on change of drop down a textfield emerging
hi,
i have a situation where i have a list of options from which a user selects
his options if its not in the list he/she selects Others/Not Present and a
new textfield should pop up and the data entered there should be considered
instead of dropdown.
i have done this using javascript/dhtml but i was wondering how this can be
done using pure rails i.e using some of the RoR apis?.
i would
2006 Jun 18
5
on change of drop down showing a new textfield
hi,
i have a situation where i have a list of options from which a user selects
his options if its not in the list he/she selects Others/Not Present and a
new textfield should pop up and the data entered there should be considered
instead of dropdown.
i have done this using javascript/dhtml but i was wondering how this can be
done using pure rails i.e using some of the RoR apis?.
i would
2005 Dec 29
0
textfield helper - formatting the displayed text
Is there a way to have a textfield helper format the displayed field? I''d
like to invoke the number_to_currency method on the number that get''s
displayed, but I can''t figure out how to do it. I tried:
<%= text_field ''product'', number_to_currency(''price'') %> and that didn''t
seem to work...
Will I just have to use
2006 Mar 14
2
autocomplete using other models
I''ve asked this in various ways but I can''t seem to get much traction -
my guess is because not many people are doing this.
I am working in a controller/views called placements. Placements
belongs_to :client
I have a clients model/table - clients has_many :placements
in placements/find...this works fine...
<%= text_field_with_auto_complete :placement, :clwholename, {} %>
2008 Jan 18
2
autocomplete for
I have this code in my view:
<%= text_field_with_auto_complete :client, :name %>
when I submit new, y get:
"client"=>{"name"=>"MSO"}
I want to get:
"repair_ticket"=>{"client_id"=>"??"}
My models are
class Client < ActiveRecord::Base
has_many :repair_tickets
end
class RepairTicket <
2010 Jan 07
1
text field with autocomplete
Hey everybody,
I am using text field with autocomplete in my posts new action. That
works great.
Response from autocompleter in firebug:
POST http://localhost:3001/posts/auto_complete_for_tag_name 200 OK 68ms
but if I use the same in edit action it fails and I got this error.
POST http://localhost:3001/posts/781/auto_complete_for_tag_name 404 Not
Found 81ms
*** POSTS controller: ***
def
2011 Sep 27
0
has_many with :finder_sql returns [nil]?
Is it supposed to do that? I find it very confusing.
AR 3.0.10
class Unit
has_many :units, :finder_sql => proc {
"SELECT * FROM `#{table_name}` WHERE `location_id`=#{id} AND
`location_type`=#{Location::UNIT}" }
end
Both should return []. However...
>> Unit.first.units.find([1000000])
[2011-09-27 10:05:11|main|debug] Unit Load (4.0ms) SELECT `units`.*
FROM `units`
2009 Aug 13
10
default value if textfield is empty
Hey all,
im not sure where to set a default value if a textfield is empty?
For now i do it in the controller, and check if the submitted parameter
is blank.
But this seems not to be the best solution...
Thanks for your help!
--
Posted via http://www.ruby-forum.com/.
2008 Jun 12
1
unidirectional belongs_to polymorphic
The setup:
class Location::Base < ActiveRecord::Base
set_table_name :locations
...
end
class Location::Address < Location::Base
...
end
class Location::Airport < Location::Base
...
end
class Person < ActiveRecord::Base
belongs_to :location, :polymorphic => true, :class_name =>
"Location::Base"
...
end
I want a unidirectional belongs_to relationship. That
2006 Aug 09
0
Two Autocompletes, make first value affect the second
I have two text_field_with_auto_complete
text_field_with_auto_complete :user, :state
text_field_with_auto_complete :user, :suburb
The user fills in the text_field_with autocomplete... but then I want to
filter the results in the suburb with the value they''ve just entered
def auto_complete_for_user_suburb
@suburbs = PostCode.find(:all,
:conditions => ["lower(locality)
2006 Aug 01
0
Custom Autocomplete Field - Making a field lowercase
I''m trying to humanize() the results that appear in the autocomplet drop
down list.
First i customised the controller.
In the render line on the controller it is saying "i want to use locality on
each of the @items".
So locality is what i want to humanize".
My ideas so far is to:
Customise the PostCode object so that when auto_complete_result trys to call
2006 May 22
0
(nebie) Autocomplete and many to one relationship?
All,
I''m trying to get autocomplete to work for the first time.
I''m not sure if I''m doing this right or not.
I have a table where one of the fields is a employees name. I expect a
relatively small collection of person''s names will be used.
I created a simple employees table with just 2 fields: id, and name.
Then in my main table I added a employee_id field
2006 May 30
0
autocomplete - updating 2 or more fields
I want to use autocomplete (text_field_with_auto_complete) to update
several field s if a match is found. I.e. a user types something in the
autocomplete field, a match is found, the application then goes and
fetches some more values from the database and populates some fields on
the form based on the match found. Has anybody done anything like this?
Any advice very much appreciated. Many
2006 Feb 13
1
autocomplete input field name
Hi All,
I''m new to ruby on rails and I struggle with a problem in my first
application. I searched the forum (and ofcourse google) but I think it
is just an easy thing that nobody boughters to write down :)
I am building a kind of library application for (fysical) books and
e-books and later I want to add other functions like knowledge
management.
The problem: in the book show page
2006 Jan 10
0
Customizing autocomplete to update more than one value upon vaule select
Good day.
Currently I have a system that will successfully add a row to a table.
Each row in this table will represent a new product being added to a
purchase order.
The user can enter a quantity and then select a product code.
The product code is the auto_complete field. This field works.
However, once the user selects a product code then the values for the
product description, buy price, and
2009 Oct 29
0
Javascript in text field with autocomplete
If I am using the autocomplete plugin, and I have a text field
specified in a form that incorporates autocomplete, such as:
<%=
text_field_with_auto_complete :doctor, :organization, :autocomplete =>
"off" %>
how can I put javascript event handlers to if (e.g. keypress,
onchange, etc.) ? WHat I really want to do is call a method in my
controller if either:
1. The text field is
2010 Jul 22
0
Autocomplete - Search Multiple Tables
I''m trying to implement Autocomplete on my site and allow customers to
search for restaurants by name or city all from one search box.
I can''t seem how to get one edit field to interact with Autocomplete
from multiple controllers. I can add the appropriate code into the
controllers to allow access on the page, but how would I modify:
<% text_field_with_auto_complete
2008 Nov 05
4
select in form - best practice?
Q. What resource do readers recommend for referencing regarding best
practices for form construction in Rails?
I have the following situation: location_type of Locations may have one
of five (5) possible codes. Presently I have these codes listed in a
drop-down select constructed thusly:
<p>
<b>Location type</b><br />
<%= f.select :location_type,
2006 Nov 04
0
form_remote_tag problems with post url
Hi,
I''m hitting a bump with the form_remote_tag, and wondering if anyone can
help.. SO i''m trying to implement a tag-based search on a site and using
routes, I can enter a url such as http://localhost/tag/query , which calls
an action ''search'', and returns all the posts which are tagged with the word
''query''..
fine...
In the
2006 Jul 06
0
Ajax form results display help
I''m not that familiar with Ajax, so there is a good chance that I''m
doing something incredibly stupid, but here is the issue. I have a
search form that will display results on submit using Ajax callbacks
and cool effects.
Here is the operation that I would like
-User enters data
- On submit of the form, the spinner shows
- If there is an error, the error div is shown and