| 318 | | # can specify a function to be called instead. |
|---|
| | 318 | # can specify javascript code to be called instead. |
|---|
| | 319 | # Note that the value of this option is used as the |
|---|
| | 320 | # *body* of the javascript function, a function definition |
|---|
| | 321 | # with parameters named element and value will be generated for you |
|---|
| | 322 | # for example: |
|---|
| | 323 | # observe_field("glass", :frequency => 1, :function => "alert('Element changed')") |
|---|
| | 324 | # will generate: |
|---|
| | 325 | # new Form.Element.Observer('glass', 1, function(element, value) {alert('Element changed')}) |
|---|
| | 326 | # The element parameter is the DOM element being observed, and the value is its value at the |
|---|
| | 327 | # time the observer is triggered. |
|---|