drupal-fapi

Problems in user - registration module in DRUPAL

Hello Guys, I have some problem in drupal registration page. I want to change whole user registration page. in registration module i want to add new field type. Bcz i want that user can choose the date from date-time picker. I have ready date-time picker which i have implement, but i don't know where to put that code. I want to...

Form values appear blank when submitting to the database - Drupal FormAPI

Hello, I have been working on this drupal form API script for past week and half. to give an insight into my problem.. the form below merely lists a host of database records which contain 5 individual scoring ranks. (mind, action, relationship, language and IT). this code is apart of my own custom module where all values are listed fro...

How can give validation on custom registration form in drupal?

Hey Friends, I have created custom registration form in drupal 6. i have used changed the behavior of the drupal registration page by adding this code in themes. template file function earthen_theme($existing, $type, $theme, $path) { return array( // tell Drupal what template to use for the user register form 'user_register' =...

Getting altered form values in drupal

I created one module in drupal name as newmodule.I use form alter to alter user registration form for adding one field location.When i submit the form, how i can get the value of the new field which i created . ...

Drupal: How to Render Results of Form on Same Page as Form

How would I print the results of a form submission on the same page as the form itself? Relevant hook_menu: $items['admin/content/ncbi_subsites/paths'] = array( 'title' => 'Paths', 'description' => 'Paths for a particular subsite', 'page callback' => 'ncbi_subsites_show_path_page', 'access arguments'...

How remove node ID [nid:n] in NodeReference fields

Hi. This is the same question of this link: http://stackoverflow.com/questions/1515722/removing-nidn-in-nodereference-autocomplete According with the first answer (Grayside) I've created my own module and activated. Then I create a new content, I look sth up in the nodereference field and finally select it -> it works (Doesn't appear ...

AJAX in Drupal Forms?

How would you go about constructing a step by step form that uses AJAX through Drupal to pull the next form step? For example, Step 1: I like Baseball I don't like Baseball. When that person clicks on either Like or Don't Like, I want to use AJAX to recognize and pull the next part of the form, remove/hide the first section sin...

Adding Facebook Log in button to PHP code

I am trying to add the new Facebook log in button to my registration page on my Drupal site. I know the following code is wrong, but I don't know the right syntax to implement it: function facebook_user($op, &$edit, &$user, $category = NULL) { switch($op) { // User is registering. case 'register': // Add a Facebook login button. ech...

Customized User Registration Form

Hey Guys, i have made user-register.tpl.php file. And i have set many text field in that. But now i need that.... i want to store the users information to the database. bcz i have created the customized registration page, so i need that my text field values should be store in the database. like this....... Username: <input type="te...

Displaying Array in Select - FORM API Drupal

Hi: I want to add key(type_id) and value(type_description) to select in drupal form API $result_x->product_types->RPMProductType is array result from Database :- array(4) { [0]=> object(stdClass)#18 (2) { ["type_description"]=> string(10) "Calendered" ["type_id"]=> int(1) } [1]=> object(stdClass)#19 (2) { ["type_description"]=> s...

Drupal Module Development: How to Communicate between form_submit and page handler functions

I am writing a module and I need to retrieve values set in a form_submit function from a page handler function. The reason is that I am rendering results of a form submit on the same page as the page handler. I have this working, but I am using global variables, which I don't like. I'd like to be able to use the $form_state['storage'] ...

How do I use a custom #theme function to a fieldset in a drupal module?

I have a module that builds a form that includes a fieldset. Instead of using the <legend> element to render the fieldset title, I want to place this content in a <div> element instead. But I want to change the behavior only for the form returned by my module, so I don't want to place any new functionality into my theme's template.php ...

Validation on user registration form ?

Hey Guys, i have made module in which i am trying to add validation like if the user had entered the characters in "Phone No" text filed and same on "Mobile No". This will run when user had open the user registration form. I have made this.... <?php function form_intro_form_alter($form_id,&$form){ if($form_id == 'user_register' || ...

Theming Drupal Add Block form via forms API.

Hiya, Can anyone advise me on customising the Add Block form? (/admin/build/block/add) I want to hide the "User specific visibility settings" and "Role specific visibility settings" from users. This is what i've got so far, but obviously it's not right and I can't figure out what the array is. Anyone got the experience on this? functi...

How to make drupal known submitting custom content

Hi, I know this is not a drupal forum but, as I’m not getting any response there, I decided to give it a shot here. I’m creating a web site that accepts custom content from users. So, for that matter, this site has a form and a custom module. Instead of using admin theme, this form is placed inside custom template which is created to...

Checking whether a user already exists in drupal.

Hello, When a user enters his login information and hits submit, i want to check if the user already exists or not. So, i have the following two questions 1. Which hook is needed to be implemented , for the case when user hits the submit button on the login form. I need the username entered by the user. 2. How to check if a user already...

form layout in drupal from a module

I created my own module called "cssswitch". I'm trying to create my own html layout to display the admin form portion of the module. I understand how to use the hook_form_alter() to modify form elements, but I need to create the entire form layout to make some fields appear next to each other. It seems I need something like the way I hav...

Default values for Content Taxonomy fields in Drupal with Hierarchical Select widget

I'm trying to set the default value for a Content Taxonomy field in a hook_form_alter, but can't pin down the necessary format. I've tried this and many variations: foreach (element_children($form) as $child) { // Set $default_value. if ($form[$child]['tids']) { // This, for Content Taxonomy fields, isn't working: $form[$child]['...

Drupal form with custom ID

Correct me if I'm wrong, after reading drupal fapi related articles, I got the impression that fapi generates 'id' attributes by itself. It allows developers to assign 'name' attribute only. If that's the case, is there a way I can set desire 'id' value for elements? Because, I want my elements to have meaningful 'id' so that html/jquery...

Drupal: how to set collapsed property for edit-content fields

hi, is there any interface to decide which fields should be collapsed and which ones not in content pages ? i.e. Tags is collapsed Menu Settings is expanded, Authoring is expanded.. I would like the opposite. thanks Updated: Taxonomy super-select field (how can I refer to this field ('taxonomy' is not working)) <div class="taxonomy-s...