homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Loading Saved Data in Jeditable (Jquery plugin) in Classic ASP
Loading Saved Data in Jeditable (Jquery plugin) in Classic ASP

10+ Year Member

Msg#: 4271646 posted 6:22 pm on Feb 24, 2011 (gmt 0)

In Classic ASP (VB), I'm working with the Jquery plugin, "Jeditable," which allows the user to 'edit in place.' While I've got the code to save to the database, I'm having problems in getting the saved data to appear in the page, barring a page reload, which defeats the main purpose of using Jquery/Ajax.

Also, getting the data to appear in the editable textarea without html markup (such as '<br>') has been a challenge....

Thanks for any help or ideas - much appreciated.

Here's the code for the 2 pages I have:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<% strConnectDB = "Test_a" %>
<!--#include virtual="ConnectDB.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>

<script src="jquery_editable/jquery.jeditable.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">

$(document).ready(function() {
$(".editable_textile").editable("update_record.asp", {
indicator : "<img src='indicator.gif'>",
id : 'elementid',
name : 'newvalue',
type : 'textarea',
submit : "OK",
cancel : "Cancel",
tooltip : "Click to edit...",
height : "80px",
width : "175px",
data: function(value, settings) {
var retval = value.replace(/<br[\s\/]?>/gi, '\n');
return retval;



<%strSQL="Select * FROM AMS_test Where NotesID = '282'"%>
<!--#include virtual="QryDbCommand.asp"-->
<%strNotesDesc=Replace(Replace(Replace(strNotesDesc, "''", "'"),chr(10),"<br>"),chr(13),"<br>")%>

<div class="editable_textile" id="paragraph_2"><%=strNotesDesc%></div>

<!--#include virtual="DisconnectDB.asp"-->



if editable_textile<>"" then

Dim updatedb
Set updatedb = Server.CreateObject("ADODB.Connection")

strConnString = .....

updatedb.ConnectionString = strConnString

str_editable_textile=Replace(editable_textile , "'","''")
sqlupdate = "UPDATE AMS_test SET NotesDesc = '" & str_editable_textile & "' where NotesID = '282'"

updatedb.Execute sqlupdate
Set updatedb = Nothing


strSQL="Select * FROM AMS_test Where NotesID = '282'"%>
<!--#include virtual="QryDbCommand.asp"-->
<%strNotesDesc=Replace(Replace(Replace(strNotesDesc, "''", "'"),chr(10),"<br>"),chr(13),"<br>")

end if


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved