Content von Iframe bei Formular mit an PHP schicken!

Headymaster

Erfahrenes Mitglied
Hallo!

Und zwar möchte ich bei meinem Formular....z.b. Gästebuch, dass wenn ich den Beitrag abschicke, der Eintrag in den Iframe der durch Javascript bearbeitet wird mit an das bearbeitende php script gesendet wird, aber wie mache ich das?!

Hier mal die nötigen Dateien wie es im moment ist...

Formular:
HTML:
<form action="index.php?s=gb.php" method="post">
    <tr>
	    <td class="gb_add"><b>[gb_name]:</b></td>
		<td class="gb_add"><input type="text" name="name" class="form"></td>
	</tr>
	<tr>
	    <td class="gb_add"><b>[gb_email]:</b></td>
		<td class="gb_add"><input type="text" name="email" class="form"></td>
	</tr>
	<tr>
	    <td class="gb_add"><b>[gb_title]:</b></td>
		<td class="gb_add"><input type="text" name="title" class="form"></td>
	</tr>
	<tr>
	    <td class="gb_add" width="80px"><b>[gb_text]:</b></td>
		<td class="gb_add">
		   <table>
		     <div align="center">
			  <tr>
			    <td bgcolor="#CCCCCC">
				  <a href="#" onclick="text_format('bold', '');"><img src="inc/images/actions/text_bold.gif"></a>
				  <a href="#" onclick="text_format('italic', '');"><img src="inc/images/actions/text_italic.gif"></a>
				  <a href="#" onclick="text_format('underline', '');"><img src="inc/images/actions/text_underline.gif"></a>
		          <a href="#" onclick="text_format('JustifyLeft', '');"><img src="inc/images/actions/text_align_left.gif"></a>
				  <a href="#" onclick="text_format('JustifyCenter','');"><img src="inc/images/actions/text_align_justify.gif"></a>
				  <a href="#" onclick="text_format('JustifyRight', '');"><img src="inc/images/actions/text_align_right.gif"></a>
				  <a href="#" onclick=""><img src="inc/images/actions/text_color.gif"></a>
				  <select class="form" >
				     <option>Size</option>
				     <option onclick="text_format('FontSize', '1');">1</option>
					 <option onclick="text_format('FontSize', '2');">2</option>
					 <option onclick="text_format('FontSize', '3');">3</option>
					 <option onclick="text_format('FontSize', '4');">4</option>
					 <option onclick="text_format('FontSize', '5');">5</option>
				  </select>
				  <select class="form">
				     <option>Font</option>
				     <option onclick="text_format('FontName', 'Arial');">Arial</option>
					 <option onclick="text_format('FontName', 'Courier');">Courier</option>
					 <option onclick="text_format('FontName', 'Times New Roman');">Times New Roman</option>
				  </select>
				  <a href="#"><img src="inc/images/actions/link_add.gif"></a>
				  <a href="#"><img src="inc/images/actions/image_add.gif"></a>
				</td>
			  </tr>
			  <tr>
			    <td class="gb_bb">
		          <iframe class="gb_bb" name="inhalt" id="bb_frame">
		          </iframe>
				</td>
			  </tr>
			 </div>
		   </table>
		</td>
	</tr>
	<tr>
	    <td class="gb_add"></td>
	    <td class="gb_add"><input type="submit" name="send" value="[add_name]" class="form"></td>
	</tr>
</form>


Das Javascript:
HTML:
// JavaScript Document
function load()
{
	getIFrameDocument('bb_frame').designMode = "on";
}

function getIFrameDocument(aID){
  // if contentDocument exists, W3C compliant (Mozilla)
  if (document.getElementById(aID).contentDocument){
    return document.getElementById(aID).contentDocument;
  } else {
    // IE
    return document.frames[aID].document;
  }
}

function text_format(command, parameter)
{
	getIFrameDocument('bb_frame').execCommand(command,false, parameter);
	document.getElementById('bb_frame').contentWindow.focus();
}


Würde mich sehr über Hilfe freuen :)

MFG Niels
 
Zurück