By prasathmn on
Hi All,
Can anyone tell me, how to build custom form with our own html codes..
Any help would be great!!
Thanks
Prasath
Hi All,
Can anyone tell me, how to build custom form with our own html codes..
Any help would be great!!
Thanks
Prasath
Comments
If you mean theming
If by 'html codes' you mean you want to theme your form page, then you could it by hook_theme().
And you may find template suggestions handy in these type of situation, to get it add the following in settings.php,
$conf['theme_debug'] = TRUE;
Use #prefix and #suffix and #attributes
If you want to wrap around your custom divs or want to add custom classes or ids or any other custom attribute to your form elements you can use the #prefix, #suffix and/or #attributes
e.g.
You can add more attrbitues to #attributes there is no limit on it.
form markup type is best feet for your requirement
you can use below code to use HTML in your form.
$html = '<div id="fiber3">
<div class="row"><h4 class="col-sm-6">1 GB</h4><p class="col-sm-6 text-right"><small></small></p></div>
<div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar"><span></span></div>
</div>
</div>';
$form['display_html'] = array(
'#type'
=> 'markup',
'#markup'
=> $html,
);