Send Form data to external url

I used to use the following code from within WordPress to let users look up which colleage company they have to contact based on their zipcode:

<form action="https://www.energiewacht.com/action/zipcodes/contactinfo/"
      method="get"
      target="_blank">
Zoek een Energiewacht servicepartner
<input class="search-field" name="zipcode" type="text" value="" placeholder="1234AB" />
<input type="submit" value="Zoek">
</form>

Unfortunately this code no longer works; when I click on “search” I see that the ‘siteurl’, in this case https://geaskb.nl, is placed before the actual link.
Despite searching on w3schools.com, stack exchange etc. I cannot find a suitable solution.

Who can tell me how I can still send the zip code to the external website so that the customer can find the right colleague company there?
The external website uses a zip code module in a different CMS than WordPress.

8 – How do I render a form in a div through a javascript call

I’m trying to load a form into a div using a javascript call. I can get the form in the div, but nothing works (autocomplete fields, wysiwyg fields, custom submit handler).

I know I must be missing something, but I can’t figure out what it is.

What I have now to get the form:

$form = Drupal::formBuilder()->getForm('Drupalmy_moduleFormMyForm');
$renderable = (
   '#theme' => 'my_form',
   '#form' => $form,
);
$rendered = Drupal::service('renderer')->renderPlain($renderable);

$response = new AjaxResponse();
$response->setData($rendered);
return $response;

I’ve also tried renderRoot instead of renderPlain, but to no avail.

The twig file looks like this (very simple):

<div id="form-container">
    {% include 'header.html.twig' with {
        type : 'manual'
    } %}
    <div class="content">
        {{ form }}
    </div>
</div>

Any help will be greatly appreciated.

8 – Missing form state values after adding submit function

I added a submit function in the form_alter hook when inserting a node:

$form('actions')('save_as_draft') = (
  '#type' => 'submit',
  '#value' => t('Save as Draft'),
  '#submit' => ('save_as_draft'),
  '#limit_validation_errors' => (),
);

In the save_as_draft() function, I want to get the address value from the form state, but there are no values (except for the additional submit button).

function save_as_draft(&$form, DrupalCoreFormFormStateInterface $form_state) {
  var_dump($form_state->getValue('field_address'));                      // outputs NULL
  var_dump($form_state->get('field_address'));                           // outputs NULL 
  var_dump($form('field_address')('widget')(0)('value')('#value'));      // outputs 'Address value'
  var_dump(array_keys($form_state->getValues())); // outputs { (0)=>  "save_as_draft" (1)=> "op" }
}

How can I get the form_state values in this alternative submit function without validating the whole form?

Is there another way of retrieving the form values instead of digging through the widget arrays?

8 – How can I prevent URLs in form fields?

Was looking around the interface to figure this out. Is there any way to prevent URLs in the form fields and prevent submission of the forms? Was looking to check for “http” and “http”s in the string.

There’s seems like a way to check for a pattern in the string… but it’s the reverse, the string needs to be there.

I am on Drupal 8.9.1.

Webform is Version: 8.x-5.16

Webform 8: Any way to prevent urls in form fields?

Was looking around the interface to figure this out. Is there any way to prevent URLs in the form fields and prevent submission of the forms? Was looking to check for “http” and “http”s in the string.

There’s seems like a way to check for a pattern in the string… but it’s the reverse, the string needs to be there.

I am on Drupal 8.9.1.

Webform is Version: 8.x-5.16

8 – How do I verify emails on a contact form?

I want to implement a functionality where anonymous users can contact node authors. I have created a contact form with email field for each node. I would like to send an email verification link to the email address for email ownership confirmation. The form submit should be complete only when that happens.

What would be the best approach to handle this? There is a module in drupal 7 which could work but I didn’t come across anything for D8. Will appreciate any help with this.