Pass field input to button attribute
-
Hi
Is it possible to pass form field input data to the submit button before its clicked?
I’ve looked at the documentation and have looked at the functions. I’m able to add static attributes but I have no idea how to pass the Date field input to the button attribute.
function filter_submit_button_attributes( $attributes, $form, $args ) { // $attributes['class'] .= ' button'; $attributes['data-bookingform-redirect'] .= 'true'; $attributes['data-hotel-id'] .= 'largehotel'; return $attributes; } add_filter( 'af/form/button_attributes/key=form_63e8ce3cdc102', 'filter_submit_button_attributes', 10, 3 );
How can i pass the form field input to an attribute? Ive tried using
$attributes['data-departure'] .= 'af_get_field( "$field_63e8ce9bb2cb9" )'; $attributes['data-arrival'] .= 'af_get_field( "$field_63e8ce6ffe3fb ")';
But this only prints it as a static attribute
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Pass field input to button attribute’ is closed to new replies.