September, 2008

Now, this script differs from the original in that you can load additional documents* into the IFRAME even after the page has loaded, and the IFRAME will dynamically adjust its height to fit the new document. So use this script if you need to not only display external content via the IFRAME tag, but intend to change this content after the page has loaded.

*All external pages loaded into the iframe must be from the same domain as the page the iframe tag is inserted in. Setting the iframe's src to an external site such as "http://www.google.com" will not work, since the script cannot probe and detect the height of pages from external domains.

Step 1: Insert the below script into the HEAD section of your page:

The quickest way should be to add a new block with PHP input format. In that block, call drupal_get_form() and output the result of that. You could do the same using a custom module.

<?php
 
global $user;
$type = 'nodetype';
$node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type);
print drupal_get_form($type . '_node_form', $node);
 
?>

Forms provide a way to send user values and choices to the server. Forms are composed of text controls, selection lists, radio buttons, checkboxes, multi-line text and other input controls. When the user clicks submit button( or in some case presses enter), the user-supplied values and choices made are sent to the server. If there is some problem with the data supplied by the user (i.e. form submission fails), the values supplied by user and the choices made must be restored. So that he/she don't have to type it again.

The following code is a small form with different type of HTML controls, has the ability to restore the values supplied and options made. Copy and paste this code into a blank PHP file and execute to see how the values are restored.