By pniraj007 on
Hi All,
I have complex html code that I want to put inside form element of page generated by form api. Form api shows no way of directly including html string in it. One has to create each and every element individual and there are limited elements. The current html code I am including becomes part of page but outside form element.
Please help I am stacked.
Comments
You do not provide enough
You do not provide enough detail to give you a specific solution but there is the '#markup' element type that takes any html as the value and elements generally support both '#prefix' and '#postfix' that allows attaching html before/after the form element.
Thanks a lot it solved my
Thanks a lot it solved my problem.
Drupal 7 - Form API - theme form tad dissapears
use theme_form() to get the form tag to render correctly: