469,352 Members | 1,754 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

putting information from iframe in hidden textfiel

hello,

i am trying to build a kind of very, very simple ritch text editor for
people to use with a very simple
cms.
at the moment i am working on the basic structure.

the text is put in an iframe.
then a hidden textfield gets the value from the content of that iframe.
then the hidden textfield is sent to a php-page so it can be put in a
database.

the problem is: the information from the hidden textfield is not in the
$_POST array on the php-page.
(there is no name/value)
the other information is ok. so the problem is with the javascript.
the information from the iframe is in the hidden textfield (i have tested it
with 'alert()'), but the hidden textfield is not
sent with the form.

does anyone know why the name/value of the hidden textfield is not sent with
the other
information of the form?

thanks
_________________ code: __________________________
<html>
<head>

<script language='javascript' type='text/javascript'>
<!-- desingMode must be 'on' ----->
function gaan(){
document.veld.document.designMode = 'On';
}

<!-- make hidden textfield -->
function verborgen(){
document.writeln('<input type="hidden" id="tekstveld" name="tekstveld"
value="">');
}

<!-- put content of the iframe in the hidden textfield -->
function toonInfo(){
tekstveld.value =
document.getElementById('veld').contentWindow.docu ment.body.innerHTML;
}

<!-- send the form/hidden textfield -->
function submitForm(){
var verborgenVeld;
verborgenVeld = document.getElementById('tekstveld');
verborgenVeld.value =
document.getElementById('veld').contentWindow.docu ment.body.innerHTML;
return true;
}

</script>

</head>
<body onLoad='gaan()'>

<script type='text/javascript'>
verborgen();
</script>

<iframe src='z_10_wegschrijven_02.php' name='veld' id='veld'></iframe>

<form action="z_11_wegschrijven_02.php" method="POST" onsubmit="return
submitForm();">
<input type='text' name='test'>
<input type='submit' name='submit' value='submit'>
</form>

</body>
</html>
_________________________ end of code ___________________________
Sep 1 '05 #1
1 1665
i already found the answer.

i had put the functioncall, to make the hidden textfield, outside the
<form></form> tags,
so it was not a part of the form.

blablavatsky
Sep 1 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Pete Wason | last post: by
5 posts views Thread by delraydog | last post: by
7 posts views Thread by Patrick.O.Ige | last post: by
3 posts views Thread by Timo | last post: by
2 posts views Thread by BillGatesFan | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.