Hello, I have only just found out about scriptoculous and am trying to see how to use it to update a MySQL database. I have a form (using the ordinary submit button) and a php script which connects to MySQL and adds the new data but would like to have the returned message saying "database updated etc" appear on the same page using ajax. Can someone please point me at how to do this with scriptoculous?! Cheers Geoff --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry! should have written scriptaculous. Geoff --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 26, 2008, at 2:17 AM, geoffcox wrote:> I have only just found out about scriptoculous and am trying to see > how to use it to update a MySQL database.JavaScript, by itself (i.e.: Scriptaculous) is never going anywhere near MySQL. But if you have an application server or CGI somewhere in between, then that is where you would get your database in line with your JavaScript. So in PHP, you could use native functions, or a framework, or something in-between, like an ORM wrapper. In Ruby, you could obviously use Rails or write something much simpler in Ruby using the CGI libraries. No matter which application server you use, you will be posting a form to the Web server, which will intercept that request and redirect it through your app server and then that layer will talk to the database. Walter --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Walter - the bit I wasn''t clear about was how to send the form contents to the php script which connects to the MySQL database. However the light has dawned! Using <d><input type=''button'' onclick=''ajaxFunction()'' value=''Send your figures'' /></td> to get the ajax vode going and var chord1 = document.getElementById(''chord1'').value etc and var queryString = "?chord1=" + chord1 etc for the jaxRequest.open("GET", "process.php" + queryString, true); does the trick. Cheers Geoff On Jan 26, 5:29 pm, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> On Jan 26, 2008, at 2:17 AM, geoffcox wrote: > > > I have only just found out about scriptoculous and am trying to see > > how to use it to update a MySQL database. > > JavaScript, by itself (i.e.: Scriptaculous) is never going anywhere > near MySQL. But if you have an application server or CGI somewhere in > between, then that is where you would get your database in line with > your JavaScript. > > So in PHP, you could use native functions, or a framework, or > something in-between, like an ORM wrapper. > > In Ruby, you could obviously use Rails or write something much > simpler in Ruby using the CGI libraries. > > No matter which application server you use, you will be posting a > form to the Web server, which will intercept that request and > redirect it through your app server and then that layer will talk to > the database. > > Walter--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---