This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Adding elements dynamically via Ajax to forms

Hi All,

When adding new elements to an existing form via AJAX using hook_form_alter, for example, clicking a checkbox adds a datefield input, hoping someone can point me in the right direction as I think the below approach seems too hacky.

It's in a .module file, so no class to set vars, so am using user input to define how the element should render.

The approach below works, however can anyone point me in the direction for the "correct" way to do this.

Removed the bulk of the code so only the relevant code is here in this post.

html tag Label doesn't work when tableselect form is in a modal.

Hello, 

I have created a tableselect form each line contain only text.  I have added each text as :

$form['user_bin'][$term->id()]['bin'] = array(
				'#type' => 'html_tag',
				'#tag' => 'label',
				'#value' => $term->get('name')->getstring(),
				'#attributes' => [
					'for' => 'edit-user-bin-' . strtolower($term->id()),
				],
			);

 I don't know if there is a better way to had this label Tag ?

File manager D7

I'm looking a way to create a shared file manager with permission on folder. Do you know a good way to do it or a module that i can modify ?

Adding a display form mode

Hi Folks

Quick question please, I'm trying to figure out how I get to display my custom form mode please as a separate edit form route (edit/linked_classes).

I have created a new form mode and added it to the config in my module so on install the display mode is there called linked_classes

I generated my custom entity type through Drupal Console and added a bundle, I expected to see a routing.yml file but instead I have a links.task.yml file.

I think this sorts out the routing for me as far as I can tell and in it I have 

One-click login, passwordless Drupal Module

Fast have just released FREE modules to enable one-click login, without passwords for both Drupal 7 and Drupal 8.

Fast was the #1 most upvoted product on Product Hunt, and is already powering passwordless login on hundreds of websites.

Now you can easily download and install Fast login on your Drupal sites, completely free, from: https://github.com/fast-af/fast-drupal-module

Developing a ROBUST website

Hi all,

I have to develop a robust website, similar to airbnb.com

The website will contain properties for rent and in each one there will be rooms. The users will be able to hire the rooms while other users will be able to advertise them. Their will be a hierarchy of property managers, rooms managers and company managers (with a few properties). The rate of the rooms will change according to days and hours. Users will be able to pay in their own currency... etc etc...

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions