By fuzzy on
Hi!
I'm building a module in witch AJAX needs to post some additional data from the form.
My question is:
- Should I use the form generation functions to generete a form, that will not send any data to the page and will only be used by javascrit
- How can I prevent the form to be submited
- Can I insert the form as a static HTML (print it out on the page)
thank you for all your help!
Comments
"needs to post some
"needs to post some additional data from the form"
"How can I prevent the form to be submited"
what are your steps here? You can add javascript to the drupal header in your module.
Can I insert the form as a static HTML - insert a form where?
Trying to understand - thanks
helping to understand
This module's page displays a tree structure, feched with AJAX, much like jQuery File Tree. But I watn to send additional data (like filetype/extention or date of creation) to the server side connector script. This data is gathered from a couple of <input> elements, a form. This form should not be submited as a regular form would be, insted it shuld only serve as an user interface to the data, the javascript/jquery will use (in it's ajax post).
so I could set up the form as a static HTML from my "build this module's site" function and send it (as a string) to hook_menu → item → 'type' => MENU_NORMAL_ITEM → 'page callback' => "-------this-site-and-the-form-on-it-------"
but I am thinking this is not the best solution.
or
I could use form generation functions, wich would produce a form with submit button, reset button, form handlers and so on. This is what I don't want.
thanks for your effort!