Marino Software - Easy to use web applications and websites

Cascade text_field_with_auto_complete

Posted by Keith Davey on April 02, 2007 at 06:09 PM

In the last few days I wanted to create part of our address entry partial using text_field_with_auto_complete. I did some googling but in the end it required some brain power to figure out myself.

Adding them is easy. I have a Country, County and Location entry field so I added three text_field_with_auto_complete boxes, one for each like so:

<div class="formElement"><label>Country: </label>
<%= text_field_with_auto_complete
 :country, :name,{}, :indicator => "country_activity" %>
    <span id="country_activity" style="display:none;" ><%= image_tag 'spinner.gif'%>
</span></div>

and so on. The indicator attribute allows you to specify an element in the document which becomes visible while the text_field_withautocomplete is carrying out a query.

Post continues, click to read more...

Comments: 0 (view/add your own) Tags: ajax, rails