putting information from iframe in hidden textfiel

  • Thread starter Madame Blablavatsky
  • Start date
M

Madame Blablavatsky

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.document.body.innerHTML;
}

<!-- send the form/hidden textfield -->
function submitForm(){
var verborgenVeld;
verborgenVeld = document.getElementById('tekstveld');
verborgenVeld.value =
document.getElementById('veld').contentWindow.document.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 ___________________________
 
M

Madame Blablavatsky

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top