Thanks for the code, Michael. that does make it clearer!
 
Boy, it sure would be helpful if we have some site that took
the various plug-ins and worked them over from a particular
language perspective.  As in "How to use xyz plug-in with Cold Fusion", etc.
 
Thanks a lot!
 
Rick
 
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Michael E. Carluen
Sent: Friday, March 09, 2007 4:34 AM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] How do I hook up the "Editable" plug-in to a MySQL DB?
 
Hey Rick:
 
See if this makes sense to you. I just made a CF page from Mika's Editable
example.
 
Hth.
 
Michael
 
 
---------
On your Form Page:
 
The jQuery:
$(document).ready(function() {
      $(".theclass").editable("http://www.example.com/save.cfm";, {
          type   : 'textarea',
          submit : 'OK'
      });
});
 
The html:
<p class="theclass" id="home#get_houses.unique_id#>#get_houses.address#</p>

 
 
 
---------
On your save.cfm:
 
<cfset type = left(FORM.id,2)> 
<cfset unique_id = removeChars(FORM.id,1,2)>
<cfset value = trim(FORM.value)>
 
<cfquery datasource="my_database">
            UPDATE      homes_table
            SET         homes_table.address = <cfqueryparam
cfsqltype="CF_SQL_VARCHAR" value="#value#">
            WHERE       homes_table.unique_id = <cfqueryparam
cfsqltype="CF_SQL_INTEGER" value="#unique_id#">
      </cfquery>
</cfif>
 
 
 
 
 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Mika Tuupola
> Sent: Friday, March 09, 2007 12:55 AM
> To: jQuery Discussion.
> Subject: Re: [jQuery] How do I hook up the "Editable" plug-in to a MySQL
> DB?
> 
> 
> On 9 Mar 2007, at 02:44, Rick Faircloth wrote:
> 
> > I don't see how to hook the "Editable" plug-in to *any* datasource
> > right now.
> >
> You mean you want to save the text you edit to the database? For
> jEditable first and only mandatory parameter is the URL where edited
> content is POST:ed to. For example:
> 
> $(document).ready(function() {
>      $(".editable").editable("http://www.example.com/save.php";, {
>          type   : 'textarea',
>          submit : 'OK'
>      });
> });
> 
> With whis example when you edit stuff and click ok stuff gets POST:ed
> to http://www.example.com/save.php. This script should then save
> content to database. You can check examples at:
> 
> http://www.appelsiini.net/~tuupola/javascript/jEditable/
> 
> or browse example source code at:
> 
> http://svn.appelsiini.net/viewvc/jQuery_jEditable/trunk/examples/
> 
> JavaScript itself does not connect to database. You need to use some
> serverside language such as PHP, Ruby or Perl for that.
> 
> 
> --
> Mika Tuupola                      http://www.appelsiini.net/~tuupola/
> 
> 
> 
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to