Alex Duffield wrote:
> How do I stop my JS from erring if I call an element that does not  
> exist.
> 
> I have a form that is dynamically generated on the server (PHP)
> 
> I have a script that calls $F('foobar') but it might be the case that  
> that field does not exist.

Don't use $F. That's the way it's designed to behave. Just use $() instead.

if( $('foobar') ) {
  var value = $('foobar').value;
}

-- 
Michael Peters
Developer
Plus Three, LP


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to