eWebEditor Home >> eWebEditor Manual V11.2 >> Developer Guide

3.4 Retrieving code from a form post

Make sure that eWebEditor is placed within a form.

When the form is submitted eWebEditor will behave exactly as if it were a textarea.

Example:

In the following example we are going to create a HTML script to display the editor and an ASP script to retrieve the code and display it.

Create a HTML script called 'editor.html' and put the following code in it:

<html>

<head>

<title>Untitled</title>

</head>

<body>

<form name="myform" method="post" action="display.asp">

<input type="hidden" name="content1" value="">

<iframe ID="eWebEditor1" src="/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>

<input type="submit" name="btnSubmit" value="Submit">

</form>

</body>

</html>

 

ASP:

Create an ASP script and call it 'display.asp' and put the following in it:

<%

  Response.Write Request("content1")

%>

 

PHP:

Create a PHP script and call it 'display.php' and put the following in it:

<?php

echo stripslashes($_POST['content1']);

?>

 

Run the first script and you should see the editor displayed. Type up a document in the editor and click 'Submit'. The data will be sent to the second ASP script, which will display it.

In an actual document editing system you would save this data to a database or file rather than displaying it. Please see the example application in the examples folder.