Print Page | Close Window

REQ: Ajax Post Preview Quick Reply On Same Page

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=22009
Printed Date: 29 March 2026 at 10:54pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: REQ: Ajax Post Preview Quick Reply On Same Page
Posted By: myhyipforum.com
Subject: REQ: Ajax Post Preview Quick Reply On Same Page
Date Posted: 23 November 2006 at 6:35am
my forum hirarki:

domain.com/forum/includes/quick_reply_form_inc.asp line 1
<br/>

<div class="msgBody" style="border:6px dashed #eee;background:#eee;width:140px;margin:0 auto ;">

<div id="txtResults" style="width:100%;height: 20px;padding:10px;text-align:center;">

<p style="font-style:italic">Ajax Words Count.</p>

</div>

</div>

<br/>



'Create the text area

Response.Write(vbCrLf & " <textarea name=""message"" id=""message"" cols=""57"" rows=""5"" wrap=""virtual"" onKeyUp=""preview(this.value);"" >")

Response.Write("</textarea>")




domain.com/js/ajax/ajax_2.js

var xmlHttp



function showResults(str)

{

xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)

{

alert ("Your browser does not support the XMLHttpRequest object.")

return

}

var url="../forum/plp_getResults.asp"

url=url+"?username="+str

url=url+"&sid="+Math.random()

xmlHttp.onreadystatechange=stateChanged

xmlHttp.open("GET",url,true)

xmlHttp.send(null)

}



function stateChanged()

{

if (xmlHttp.readyState == 0)

{

document.getElementById("txtResults").innerHTML = "<p> Search in progress...</p>"; //loading

}

else if(xmlHttp.readyState == 1)

{

document.getElementById("txtResults").innerHTML = "<p> Search in progress...</p>"; //loaded

}

else if(xmlHttp.readyState == 2)

{

document.getElementById("txtResults").innerHTML = "<p> Search in progress...</p>"; //interactive

}

else if(xmlHttp.readyState == 3)

{

document.getElementById("txtResults").innerHTML = "<p> Loading data...</p>";

}

else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

{

document.getElementById("txtResults").innerHTML=xmlHttp.responseText

}

}



function GetXmlHttpObject()

{

var objXMLHttp=null

try

{

objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); //later IE

}

catch (e)

{

try

{

objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); //earlier IE

}

catch (e)

{

objXMLHttp = null;

}

}

if (objXMLHttp==null)
{
objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari
}
return objXMLHttp
}

function characterCounter(charNoBox, textFeild) {
document.getElementById(charNoBox).value = document.getElementById(textFeild).value.length;
}

function countWords(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support the XMLHttpRequest object.")
return
}
var url="../forum/plp_countWords.asp"
url=url+"?words="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function preview(message)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Your browser does not support the XMLHttpRequest object.")
return
}
var url="../forum/plp_preview.asp"
url=url+"?pre="+message
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("POST",url,true)
xmlHttp.send(null)
}




domain.com/forum/includes/header.asp

<script language="JavaScript" src="../js/ajax/ajax_2.js"></script>
<script language="javascript" src="includes/default_javascript.js" type="text/javascript"></script>



domain.com/forum/plp_preview.asp
[code]
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_format_post.asp" -->
<!--#include file="includes/emoticons_inc.asp" -->
<!--#include file="RTE_configuration/RTE_setup.asp" -->
<%
'****************************************************************************************
'** Copyright Notice
'**
'** Web Wiz Guide - Web Wiz Rich Text Editor
'** http://www.richtexteditor.org
'**
'** Copyright 2002-2005 Bruce Corkhill All Rights Reserved.
'**
'** This program is free software; you can modify (at your own risk) any part of it
'** under the terms of the License that accompanies this software and use it both
'** privately and commercially.
'**
'** All copyright notices must remain in tacked in the scripts and the
'** outputted HTML.
'**
'** You may use parts of this program in your own private work, but you may NOT
'** redistribute, repackage, or sell the whole or any part of this program even
'** if it is modified or reverse engineered in whole or in part without express
'** permission from the author.
'**
'** You may not pass the whole or any part of this application off as your own work.
'**
'** You may not deactivate any adverts or links to Web Wiz Guide and it’s associates
'** and must remain visible when the pages are viewed unless permission is first granted
'** by the copyright holder.
'**
'** This program is distributed in the hope that it will be useful,
'** but WITHOUT ANY WARRANTY; without even the implied warranty of
'** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'** WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'** You should have received a copy of the License along with this program;
'** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom.
'**
'**
'** Official support is available for this program through the free support forum at: -
'** http://www.webwiz.net/forum
'**
'** Support questions are NOT answered by e-mail ever!
'**
'** For correspondence or non support questions contact: -

'**
'** Web Wiz Guide, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, UK, BH15 4JD
'**
'****************************************************************************************


'Set the response buffer to true as we maybe redirecting
Response.Buffer = True


Dim strPreviewTextarea 'Holds the Users Message


'Make sure this page is not cached
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"

'Read in the message to be previewed
strPreviewTextarea = Request.QueryString("pre")


'Place format posts posted with the WYSIWYG Editor (RTE)
If Request.Form("browser") = "RTE" Then
'Call the function to format WYSIWYG posts
strPreviewTextarea = WYSIWYGFormatPost(strPreviewTextarea)

'Else standrd editor is used so convert forum codes
Else
'Call the function to format posts
strPreviewTextarea = FormatPost(strPreviewTextarea)
End If


'If the user wants forum codes enabled then format the post using them
'If Request.Form("forumCodes") Then strPreviewTextarea = FormatForumCodes(strPreviewTextarea)
strPreviewTextarea = FormatForumCodes(strPreviewTextarea)<

-------------
- READ FIRST http://webwizguide.info/bbs/forum_posts.asp?TID=22292 - Guide to Modifications .. Removing Ads ..



Replies:
Posted By: iSec
Date Posted: 23 November 2006 at 7:40am

Are you requesting a mod to be done, or is this a mod you made? and what does it do?



-------------
"When it gets dark enough, you can see the stars"
-Charles A. Beard



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net