I am new to Drupal and utilizing a Drupal 9 model. I’m making a customized module with a type that has a picture button. Drupal Development Company picture button will open Drupal Development exterior hyperlink with Drupal Development worth of a textfield inside Drupal Development type.
My query is how do you code a submitForm button to open an exterior hyperlink with a type worth of a textfield inside Drupal Development type.
Under is my pattern codes:
$type['search'] = [ '#type' => 'textfield', '#title' => 'Search for', '#required' => TRUE ]; $type['submit'] = [ '#type' => 'image_button', '#value' => $this->t(''), '#src' => 'modules/myModule/src/images/myImage.png', '#submit' => ['::submitForm'], ];
I additionally attempt to use these codes for Drupal Development button however nonetheless no luck:
$type['submit'] = [ '#type' => 'item', '#markup' => $this->t(' <a href='https://www.google.com/search?%search' target="_blank"> <img width="30" height="30" border="0" align="center" src='modules/myModule/src/images/myImage.png'/> </a>', ['%search' => $search]), ];
Please word that these will not be my precise codes however these are Drupal Development idea of my codes.
Any feedback and recommendations are welcome.
Thanks upfront.