I am new to Drupal. I have a working webapp in PHP/MySQL which I am trying to port to Drupal. Here is my problem:
I have a table called Patients with a DoB (Date of Birth) field. In the webapp, the input form takes in information as "Age" in years and months, and inputs an approximate DoB by subtracting from current date (This is because most of the patients, where this is used, are not aware of their DoB).
How to do this in Drupal? Till now, I have setup a content type called Patients with a field called DoB. It works fine with a proper calendar drop-down etc. Then I am stuck. How to achieve the above-mentioned functionality? Thanks in advance.
The functionality you need is very custom, by default Drupal cannot suggest something like this. The best way to receive the field with exactly the same functionality - it's to develop such field type from scratch. Please check the official documentation.
https://www.drupal.org/docs/8/creating-custom-modules/creating-custom-field-types-widgets-and-formatters/create-a-custom
Related
I have contact persons' list and i want to display his detail(Email,Phone number,Address etc.)
Please give me simple example for the Address field.
I want functionality like the ACF(Advance custom filed plugin which provide in WordPress.
I am using Typo3 9.5.18 version.
I would use the extension tt_address https://extensions.typo3.org/extension/tt_address/.
Cheers,
Rachel
You can follow this:
How to create complicated content elements
or this:
How to create simple content elements
or the official documentation:
Documentation
Regardless what you choose, you need to be aware of the following: In order to create a custom content element you need time to understand how it works patience and do some experiments. Once you understand the process and create 5-10 elements, then all will come automatically to you :)
Best regards
I have searched for hours and tried several approaches. No luck.
Scenario:
There is a formio Resource Form for Doctors that includes the Doc's practice number, name, address, etc.
A new form is created for prescription medication. The form has a Select component to find the doctor's practice number. Once the correct doctor is selected, the fields showing the Doc's name, surname, address, etc., must be automatically populated.
I understand that anything is possible with custom code, but this is such a common requirement that I'm convinced it can be done with standard functionality.
Can you show me how to do this?
Thanks,
Alan
In the validation tab, do a custom validation.
Using the drop down's value, look up the doctor's information.
Then, use the following code as a guide to update your fields.
FormioUtils.searchComponents(form.components, {key:"address"})[0].setValue("PO Box 123");
is it possible to have a onepage-form for editing or creating a entry and its related (1 to n) entrys?
For example: I have a customer model, every customer can have unlimited addresses. I could now have a CustomerCrudController and a AdressCrudController with the adress having select2-field for the customer, maybe having some kind of filter for the customer in the adress-list-view but it would be a more fluid working having the ability to change or add adresses in the customers-edit-view.
Thanks
Christin
There is currently no built-in way to do that right now in a Backpack CRUD create/edit form. It's planned, but will not be happening until the next version of Backpack, which might take as long as 3-6 months to launch.
What you could do is:
1) create your own custom field type, say "select_or_create_address";
2) start from the select2 field type and create your custom functionality:
the results should could be loaded with ajax;
a button next to the select could open a popup with the create address form, either:
a quick form you code yourself that inserts a new address in the db;
the AddressCrudController create form (but without the menu, sidebar, etc); for this you'd need to create another method in the AddressCrudController, base off CrudController::create() but loading a different view;
when the address successfully added, the id should be inserted in the select2 as a value;
My recommendation is to go with the quick form, it should be faster to develop and you wouldn't have to resort to solutions like iFrame popups.
Cheers!
I need to build a form where user can have an infinite number of identical fields, depending on the number which he entered in the previous field 'Number of steps'(for example).
Maybe someone have any idea?
I recommand you to check the Form API of Drupal and especially the #ajax property
Here is a great example on how to achieve what you need.
I have created a signup form for secure zone in Business Catalyst. I want to give user access to that form in order to update the fields. I have created the page and its working only problem is there is no way to pre-populate custom fields in the form. I talked to their support and research a lot but all in vain. This is very basic thing BC missing. Is there a hack for it or some alternatives?
Just adding for anyone finding this that you can also populate fields that have been created and extended in the crm if they're stored against the customer record.
{module_customerfield,crmextformID,FieldID}
eg
{module_customerfield,7470,82256}
More info in the forums.
Good News Now Business Catalyst supports this feature for more information read:
Allowing Customers to view and update CRM details
I have had this same issue and hopefully there will be someway they can fix this in the future. What I did for the time being is I used other tags that I was not using. IE module_workcity was not and won't be used by me so I then put that in a field that I needed the custom tag for. Here is a screen shot of what I am referring to. - http://screencast.com/t/b3pvuOcTi one thing to note here the screen name is different than username for this site.
Note: When the user signs up I have the person filling out a field for the "workcity" and just change the labeling.
Not sure if this is an option for you, and it can take some work but might help.
Hope this helps. - Another note BC related question you will get quicker answers on the forums there - http://businesscatalyst.com/support/forums