Error on page profil
-
Hello, I resctric 3 choices on checkbox profil and when the user choice more 3, the error come on bottom.
How to display on top nex the title choice checkbox
Thanks for your help
Michel
-
Hello @kikobyofficial
Do you mean this error message: https://prnt.sc/L4-FcEVCNe5_
You can use custom CSS code to reorder elements into the field:
.um-field.um-field-checkbox {
display: flex;
flex-direction: column;
}
.um-field.um-field-checkbox .um-field-label {
order: 1;
}
.um-field.um-field-checkbox .um-field-area {
order: 3;
}
.um-field.um-field-checkbox .um-field-error {
order: 2;
}Example: https://prnt.sc/laPAwsXWXy2w
You can add CSS code to the style.css file in the child theme. You also can add CSS code to the field “Additional CSS” on wp-admin > Appearance > Customize > Additional CSS if your theme supports this feature.
Regards
Hello thanks very much works well
Michel
Hello, I want to know if there is way to display in popup the error text ?
Michel
Hi @kikobyofficial
There is no way to display errors in popup.
You can use a code to display errors, see doc Display all form errors below the form. Wrapping errors into popup requires more customization. Try this code:
add_action( 'um_after_form', 'um_display_all_form_errors' );
function um_display_all_form_errors( $args = array() ) {
if ( ! empty( UM()->form()->errors ) ) {
$error_text = wp_strip_all_tags( implode( ' ', UM()->form()->errors ) );
?>
<div id="um_form_errors" style="display:none;">
<a href="javascript:void(0);" data-action="um_remove_modal" class="um-modal-close" aria-label="Close"><i class="um-faicon-times"></i></a>
<div class="um-modal-header">Form errors</div>
<div class="um-modal-body"><?php echo $error_text; ?></div>
</div>
<script type="text/javascript">
jQuery( window ).load( function() {
um_new_modal( 'um_form_errors', 'normal', false, '' );
} );
</script>
<?php
}
}Regards
Hello, I try to add but doesnt works, no display the popup
Thanks
Michel
hello, now its working its great thanks again very much
Hello, if I can ask you something, when there is more than 1 error, can break the line for see each error by line ??
Thanks
Michel
Hello @kikobyofficial
Yes, you can. Change the first parameter in the implode function. This parameter is a separator between strings. Try this code:
add_action( 'um_after_form', 'um_display_all_form_errors' );
function um_display_all_form_errors( $args = array() ) {
if ( ! empty( UM()->form()->errors ) ) {
$error_text = implode( '<br>', UM()->form()->errors );
?>
<div id="um_form_errors" style="display:none;">
<a href="javascript:void(0);" data-action="um_remove_modal" class="um-modal-close" aria-label="Close"><i class="um-faicon-times"></i></a>
<div class="um-modal-header">Form errors</div>
<div class="um-modal-body"><?php echo $error_text; ?></div>
</div>
<script type="text/javascript">
jQuery( window ).load( function() {
um_new_modal( 'um_form_errors', 'normal', false, '' );
} );
</script>
<?php
}
}Regards
Hello, thanks very much.
Just its great but on register display few line error with same text ( field is required ) so maybe its possible to display error from ID or maybe use this popup for only my default profile [ultimatemember form_id=”64″]
On login its great because the error come with the ID name but not for register
Thanks very much
Regards
Michel
-
This reply was modified 1 year, 8 months ago by
Anonymous User.
Hello, I do it by fill the field label on register form and display this in css
label[for=”user_email-908″]
{
display:none;
margin: 0px 0 0px 0px !important;
}Tell if its OK ?
Thanks
Regards
Hello,
The code snippet above just displays existing error messages in popup. It does not modify error messages. Verify that every field in your registration form has a label. The required error message is built using the field label in the pattern ‘%s is required’.
Regards
Hi kikobyofficial,
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help.
Regards
-
This reply was modified 1 year, 8 months ago by
The topic ‘Error on page profil’ is closed to new replies.