I have a webpage which is being rendered from my page.tpl.php , it has a login page at top - right of page.
I am kind of struggling to wrap my LOGIN HTML FORM
in Drupal Form API
Below Links did not help me that much even though it gave me general idea
1. should-i-put-input-tag-inside-label-tag
2. drupal-7-forms-how-do-you-wrap-an-input-in-a-label
3. how-to-put-two-form-elements-in-a-row-using-drupal-form-api Below image shows my Login form
theme_form_element , drupal-form-api-prefix-suffix, using-prefix-and-suffix-form-api-layout and drupal-form-wrap-div-tag-custom-html-prefix-suffix gave me some idea but I am still puzzled about this things.
{ found some more helpful links for this :
Can some one guide me for this.
I am not sure if I should go with Drupal form
or just use the normal HTML Login
in PHP
way.
For Better Understanding of the scenario I am adding screen shots and details of my task below, it is purely just for example, all I am looking for is some guidance for the task I am doing, answer does not have to be exactly FORM API of my HTML but I need to know how to achieve this in page.tpl.php.
[Do I have to create new custom module or I can manage this in my page.tpl.php- sorry if it is very simple question, I am little new here in drupal ]
Here is the HTML
<div class="accessBlock">
<button class="primary_btn">Download Guidelines</button>
<button id="loginPopup" class="primary_btn">Login</button>
</div>
<div class="loginBox" style="overflow: hidden; display: block;">
<div class="loginHolder">
<div class="nameHolder"><p class="sub-title-1">Email address</p></div>
<div class="inputHolder"><input type="text" placeholder="Enter your email address"></div>
<div class="nameHolder"><p class="sub-title-1">Password</p></div>
<div class="inputHolder"><input type="password" placeholder="Enter your password"></div>
<div class="nameHolder"><p class="sub-title-1">Not registered?</p></div>
<div class="inputHolder"><input type="checkbox" vlaue="ss"><span class="registerNote">Tick this box and click 'Register'</span></div>
<div class="buttonHolder">
<button class="primary_btn">Login</button>
<button class="primary_btn">Register</button>
<button class="primary_btn">Cancel</button>
</div>
</div>
</div>
I need to create a Login and Registration Module. I have this whole form in basic html not in form, I am struggling to convert this to Drupal From
Also I am not sure if I should go for Drupal Form
or not. Since my requirement is to show the error message in the same place <div>
. see below
Thanks :)
<div>
", "how do I add an attribute to a FAPI element", and so on. When you break your question down into smaller ones, you'll also find that they've most likely been answered before, and you can get your work done more quickly