Questions tagged [form-alter]
6 questions
3
votes
2 answers
Changing CCK Title for Form
By default a CCK form creation has a title of the form
Create [Your Content Type Name Here]
I want to change mine to
Register for Such and Such
It was suggested that I could use string-override, but I can't find the string to replace. I've also…

cgp
- 41,026
- 12
- 101
- 131
1
vote
2 answers
how to set default option of node reference cck field through form alter
I accept the arg from the url and according to the arg value I need to set the default option value, here is the code:
function ims_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'media_content_node_form':
…

Punit
- 1,110
- 1
- 8
- 14
1
vote
0 answers
Redirect to the same node for edit after node creation/edit
Drupal8 takes users to the node detailed page after creation or edit. I would like to modify the behaviour and redirect it to the node editing page.
I researched in Google and found that I should use HOOK_form_alter method in the administration…

forethought
- 2,913
- 2
- 16
- 26
1
vote
1 answer
Alter Drupal 7 Text list values when you don't know position of text list in form array
I am creating a module to alter the output of Drupal 7 text list fields.
I know that I can use hook_form_alter to do this, the problem is that the text field is output in different forms in different places and at different depths in the array…

Leo Pitt
- 69
- 1
- 3
0
votes
1 answer
Is there a way to remove first paragraph element from form edition in drupal 9?
In my node form creation, I'm trying to form_alter the default paragraph behavior.
I have a required paragraph in my node form but the paragraph field is just required if one of those fields is filled, otherwise, the user is not required to fill the…

Julio Alves
- 1
- 1
0
votes
1 answer
Silently create a user account when another form is submitted
I have a form created from another module. I want to add 2 fields to that form: 1. email, 2. password. I think I can do this with hook_form_alter. Then I would like to create a user account and log the user in when the submit button is clicked, then…

berto77
- 885
- 3
- 12
- 29