elementor / elementor/elementor

Possibility to Inject an html element inside Form?

Open
#12,903 1 comment 0 reactions 0 assignees View on GitHub
mod/q*
Dominant language
PHP
Stars
7.1k
Forks
1.6k
Avg merge
1d 5h
Merged PRs (30d)
193

Description

I am trying to inject an Html element just after the input field in the form widget. Let's say I want to put an eye Icon after Password field. I could be able to put it before field group but didn't find any filter to put it after or before inputs.

My current hacky solution is to create another field group(label, input or anything else) and setting style display:none to the old one.

If there is no such filter, is there any method to remove the field. May be something like `$form_widget->remove_render_element()`

It could be done using Javascript though. But I don't want make an extra request for that.

```php

// Password Preview Icon
if( $field['password_preview_toggle'] === 'yes' && $field['field_type'] === 'password' ){
$print_label = ! in_array( $field['field_type'], [ 'hidden', 'html', 'step' ], true );
?>

get_render_attribute_string( 'field-group' . $field_index );?>>

get_render_attribute_string( 'label' . $field_index );?>>


get_render_attribute_string( 'input' . $field_index );?>>



add_render_attribute( 'field-group' . $field_index, [
'style' => 'display:none'
]);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.