Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

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

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

6:22 pm on Feb 24, 2011 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 8, 2004
posts: 59
votes: 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