# Link\_to\_remote (AJAX) and tables: IE issues, validation?

**URL:** <https://www.ruby-forum.com/t/link-to-remote-ajax-and-tables-ie-issues-validation/66115>\
**Category:** Rails\
**Created:** [February 12, 2006, 3:01pm UTC](https://www.ruby-forum.com/t/link-to-remote-ajax-and-tables-ie-issues-validation/66115 "2006-02-12T15:01:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henrik\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c68b51/32.png) [@Henrik\_N](https://www.ruby-forum.com/u/Henrik_N)\
**Post date:** [February 12, 2006, 3:01pm UTC](https://www.ruby-forum.com/t/link-to-remote-ajax-and-tables-ie-issues-validation/66115/1 "2006-02-12T15:01:34Z")

</div>

I have a table that lists domain names, with a form next to it to add  
new domains.

I have AJAXified this so that new domains are immediately added as table  
rows. This works fine in Firefox 1.5/Win, but not in IE6/Win. Domains  
are added into the database, but the HTML table is not updated unless  
you reload the page.

Some googling tells me there are issues with e.g. link\_to\_remote  
updating tables in IE (I tried updating a div and that worked fine), so  
I’m simply asking if anyone knows of a decent solution, other than going  
non-AJAX, dropping IE support or using something other than a table.

Also, has anyone written code to get validations with link\_to\_remote? So  
if someone attempts to add a non-valid domain, you would get some sort  
of readable error message.

Some of my code:

View:

\<%= form\_remote\_tag(  
:url =\> { :action =\> ‘create’ },  
:update =\> “items”,  
:position =\> :bottom,  
:complete =\> ‘focus\_field()’) %\>

Controller:

def create  
@domain = Domain.new(params[:domain])  
if @domain.save  
render(:partial =\> ‘domain’, :object =\> @domain, :layout =\> false)  
else  
#FIXME: No decent error handling yet - try adding duplicate  
domains  
render :action =\> ‘new’  
end  
end

where “items” is a table and the domain partial a table row.

---

<div class="post-metadata">

**Author:** ![Henrik\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c68b51/32.png) [@Henrik\_N](https://www.ruby-forum.com/u/Henrik_N)\
**Post date:** [April 4, 2006, 3:11pm UTC](https://www.ruby-forum.com/t/link-to-remote-ajax-and-tables-ie-issues-validation/66115/2 "2006-04-04T15:11:12Z")

</div>

On 2/12/06, Henrik N [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Also, has anyone written code to get validations with link\_to\_remote? So  
> if someone attempts to add a non-valid domain, you would get some sort  
> of readable error message.

I’ve written an article on this subject, which you can find at

> **[AJAX validation on Rails](https://www.bigsmoke.us/ajax-validation-on-rails/)**
>
> This text discusses how I handled validation messages and other notices caused by AJAX requests.

Please let me know if you find anything uncomplete, unclear or missing,

- Rowan

---

<div class="post-metadata">

**Author:** ![Henrik\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c68b51/32.png) [@Henrik\_N](https://www.ruby-forum.com/u/Henrik_N)\
**Post date:** [May 29, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/link-to-remote-ajax-and-tables-ie-issues-validation/66115/3 "2008-05-29T22:48:45Z")

</div>

BigSmoke wrote:

> On 2/12/06, Henrik N [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Also, has anyone written code to get validations with link\_to\_remote? So  
> > if someone attempts to add a non-valid domain, you would get some sort  
> > of readable error message.
> 
> I’ve written an article on this subject, which you can find at  
> [http://www.bigsmoke.us/ajax-validations-in-rails](http://www.bigsmoke.us/ajax-validations-in-rails)
> 
> Please let me know if you find anything uncomplete, unclear or missing,
> 
> - Rowan

Hi,

I need help in this matter but that link doesnt seem to be working.  
Can u help me.

Neha
