How to show Forms in nodes stored in the node tables

Solutions

What do you mean "generate form on the fly"? As in: the form for page "page/form" doesn't exist in a canonical state but is generated based on variables such as date/url/taxonomy? Or is it just the default values for the form etc?

In anyway: the options to have a form on a page are:

  1. Hardcode HTML into the node content, e.g. <form><input> etc
  2. Use hook_menu to create the page and use the form API
  3. Use hook_menu to create the page and use the straight HTML
  4. Use hook_nodeapi to add a form to the content with the Form API
  5. Use hook_nodeapi to add a form to the content using HTML
  6. Use a module such as webforms to add the forms

I would suggest either 2 or 4. When you say that hook_menu generates these plages "on teh fly": that's not true. hook_menu is only run on cache clear, and assuming you're using caching then the generation of forms isn't going to make much difference to your server. This may be a case where you're sweating about optimisation unnecessarily.

Using Form API gives you a load of tools that you'd otherwise have to handle yourself - validation, submission, sanitising, standardising, etc.

Tags: Drupal 6 / Forms

Similar questions

Best way to break up node edit forms smaller, more manageable forms?
It's pretty common to end up with massive node edit forms once content types start accumulating fields. Collapsable fieldsets and vertical tabs help the UI, but it can still be overwhelming. Example: Say I have a local business site, and it involves a content type called 'business' which has lots of fields. One very significant field is the busines...
Modifying only node forms, not forms appearing in blocks?
I have a contact webform in a block in a sidebar that appears on every page. I also have some webform nodes. I want to use hook_form_alter() to modify the forms that are nodes, not those that appear in blocks. How can I differentiate between the two in code?
How to display data in tables using Forms API?
I want to organize my data in table rows. How can I user Forms API to do it? EDIT: I want to show the data in the following way in multiple rows: row1 checkbox info1 textfield1 info2 textfield2 .... .... rowN .... row 1 [add a new row fields here] ... row 5 One should be able to cancel existing records and in the bottom fill in fields to add new re...
How to re-generate Node Object from database stored Serialized Node Data .. and then Save as New Node?
In Drupal 7, for some reason, i am storing some serialize($node) objects into Database. So these data in the database (in text column) are storing like: Any idea please?
How to create forms similar to admin block forms
I want to create a form similar to Admin Block Settings form. So far I have created draggable table, how can I add Enable and Disable sections to the form ? I checked out Draggable Views module but it does not work out for me as I am creating a custom form.
C# web forms api to dynamically create forms
I am working on an asp.net project which has numerous form screens. All our forms are pretty much using a given set layout which needs to be made by developers ond an on again. Our current implementation requires that for every form control, a developers needs to write inside in the .aspx file the HTML of our forms (whilst embedding our field contr...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.