Hey Frank,
frank a écrit :
> <form id="formid">
> <input type="text" id="textgoeshere"/>
> <input type="submit" value="submit"/>
> </form>
>
> <div id="returngoeshere"></div>
>
> <script type="text/javascript">
>
> function fetchDataFromServer(elt, value) {
> new Ajax.Updater('returngoeshere', 'processing script', {
> parameters: 'yourServerField=' + encodeURIComponent(value)
> });
>
> }
What's with "elt, value"?! Where do *those* come from? An event
handler only gets the event as an argument. Here's your code:
function fetchDataFromServer(event) {
Event.stop(event);
var value = $F('textgoeshere');
new Ajax.Updater('returngoeshere', 'processing script', {
parameters: 'yourServerField=' + encodeURIComponent(value)
});
}
'HTH
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---