By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,645 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,645 IT Pros & Developers. It's quick & easy.

putting information from iframe in hidden textfiel

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.