Ayana Memon
Forum Replies Created
-
@missveronicatv
but country has a dependency..
and i use shortcode to make it dynamic..
in the shortcode we can do validation? any option is available..?any possibilities are available to put validation on shortcode?
@missveronicatvI am only doing some changes..
This site is alrady readymade.
I am just changing Some parts or making it dynamic..yes i added CDN Links
and yes Cannot read properties of null (reading ‘dataset’) this error is occurring.“Bitte w?hlen Sie das Land/die Region, von dem/der aus Sie am Projekt teilnehmen.” as required
yes it’s required but isn’t working at the time of registration na.. that is issue..Can you show us the shortcode also?
SURE..function my_countries_func() { $country_post = (new WP_Query(['post_type' => 'all_country', 'post_status' => 'publish', 'order' => 'ASC', 'posts_per_page' => -1])); $options = ''; if ( $country_post->have_posts() ): while ( $country_post->have_posts() ) : $country_post->the_post(); $options .='<option value="'.get_the_id().'">'.get_the_title().'</option>'; endwhile; endif; $html = '<div class="um-field-label"><label for="um-field-shortcode">'.__( 'Bitte w?hlen Sie das Land/die Region, von dem/der aus Sie am Projekt teilnehmen.*', 'ultimate-member' ).'</label></div> '; $html .= '<div class="um-field-area"> <select class="um-form-field js-states valid form-control" name="teacher_country" id="my_country" onclick="get_all_city(this.value)" required> <option value= " ">Bitte w?hlen Sie ein Land</option> '.$options.' <option value="new_country" id="other_country">Anderes Land</option> </select> </div>'; return $html; } add_shortcode( 'my_countries', 'my_countries_func' );
sure
add_action('um_submit_form_errors_hook_','um_custom_validate_form', 999, 1); function um_custom_validate_form( $shortcode_args ) { global $ultimatemember; $teacher_country = $shortcode_args['um_shortcode_10774_11']; if ( !strstr( $teacher_country, " " )){ $ultimatemember->classes['form']->add_error( 'teacher_country', 'You must register this field.' ); } }
this code i used..
i know i tried this but it’s not working,
i create short code in functions.php file after use it in the ultimate member registration form.
field->shortcode.