Hi everyone,

first, i'm new to Prototype. I want to extend Prototypes Form.Element
class with a few function like this:

Object.extend(Form.Element,{
          pointize : function(element) {
                if ($(element).present()) {
                        return element.getValue().sub(',','.');
                }
                return element.getValue();
          },
          toFloat: function(element) {
            if ($(element).present()) {
                return parseFloat(element.pointize());
            }
            return 0.0;
          },
          toInt: function(element) {
            if ($(element).present()) {
                return parseInt(element.pointize());
            }
            return 0;
          }
        });

But if i want to call one of these functions on an input element like $
(myInputElementId).toFloat() i always get an error that toFloat is not
a function... what do i wrong?


Thanx in advance!
Bye Dan
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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