Is there a way to break up the email address field into two fields?

I have a client who is insisting on breaking up the email address form fields like in the attached image. Is this possible?

Thanks in advance for any insight.

This will overall be more trouble than it’s aesthetically worth (which in my opinion would not be much, seems potentially very frustrating for users and could lead to you missing out on email leads) however…

The easiest way to handle this behind the scenes would likely be to just use two separate single line text fields that you then programmatically join together the values of in another hidden field so you have the actual combined email address when all is said and done.

Something like the following using the gform_pre_submission filter in your theme functions.php file or a custom functions plugin could do that, this populates a hidden field (ID 3) with the combined values of fields 1 and 2 joined by an @ sign only on a specific form (ID 117).

add_action( 'gform_pre_submission_117', function( $form ) {

	$_POST['input_3'] = rgpost( 'input_1' ) . '@' . rgpost( 'input_2' );

} );

The above gives you the following in the entry: Screen Shot on 2021-08-24 at 00-31-01.png - Droplr

For the layout on the front-end, you’ll need to write some custom CSS, mostly to get the @ sign between the fields.

1 Like

Thanks Karl. I agree, more trouble than it’s worth. I’ll try this and see how it goes. I appreciate your help.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.