retrieve data from IFrame textbox

G

Guest

Hi all

i'm having a little problem
I have a aspx file with a iFrame defined
The iframe is loaded with a html webeditor
After editing data in the webeditor textbox, i want t
get the data to a hidden field in the aspx file
What is the best way todo this
Is it possible to add some sample code because a i have tried a lo
but nothing works

mypage.aspx(html source
-----------------------------

<iframe id="iFrameAbstractBody" style="Z-INDEX: 103; LEFT: 24px; WIDTH: 800px; POSITION: absolute; TOP: 112px; HEIGHT: 680px
src="../Editor/htmlEditor/hostHtmlEditor.HTML" frameBorder="no" width="800" height="700"></iframe
here i have the iframe added!
mypage.aspx(vb source
---------------------------
Private Sub cmdContinue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdContinue.Clic
cmdContinue.Attributes.Add("onClick",
"document.Form1.txtgetDataFromIFrameElement.value = iFrameAbstractBody.document.editarea.innerHTML;"
End Su

Here i have a button that should bring the data to de aspx hidden field
Whats wrong here
Or am i wrong

Thanxs in advance
 
B

Brian K. Williams

I hope this helps... If you are actually going to post the data in the from
then you will need to add the validationRequest="false" otherwise you will
get the unsafe code error.

-Brian K. Williams

***** ASPX *****
<%@ Page language="c#" validateRequest="false" Codebehind="HTMLEdit.aspx.cs"
AutoEventWireup="false" Inherits="TestApp.HTMLEdit" %>
<HTML>
<HEAD>
<title></title>
<meta stuf....
</HEAD>
<body...
<form id="Form1" method="post" runat="server">
<iframe id="iFrameAbstractBody" style="Z-INDEX: 101; LEFT: 24px; WIDTH:
800px; POSITION: absolute; TOP: 112px; HEIGHT: 680px"
src="HTMLEditor.htm" frameBorder="no" width="800" height="700"></iframe>
<asp:TextBox id="txbHTML" style="Z-INDEX: 102; LEFT: 32px; POSITION:
absolute; TOP: 16px" runat="server"
Width="592px" Height="56px"></asp:TextBox>
</form>
</body>
</HTML>


***** HTML With Web Editor *****
<html>
<head>
<title></title>
<meta stuf...
<script>
function submitHTML()
{
parent.document.all.item("txbHTML").value =
document.all.item("divHTMLArea").innerHTML;
}
</script>
</head>
<body>
<div id="divHTMLArea">
This is <b>some</b> text...
</div>
<label id=lblSubmit onclick=submitHTML()>Submit</label>
</body>
</html>

Jan Van Steenbergen said:
Hi all,

i'm having a little problem.
I have a aspx file with a iFrame defined!
The iframe is loaded with a html webeditor.
After editing data in the webeditor textbox, i want to
get the data to a hidden field in the aspx file.
What is the best way todo this?
Is it possible to add some sample code because a i have tried a lot
but nothing works?

mypage.aspx(html source)
800px; POSITION: absolute; TOP: 112px; HEIGHT: 680px"
src="../Editor/htmlEditor/hostHtmlEditor.HTML" frameBorder="no"
width="800" height="700"> said:
here i have the iframe added!!
mypage.aspx(vb source)
System.EventArgs) Handles cmdContinue.Click
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top