Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: show error message in mdb-input

Pisarev pro asked 6 years ago


Hi, I try to use an error message with mdb-input component but it doesn't work:
<mdb-input type="text" id="name" :invalid="true" :error-msg="'some error...'" :value="name" @input="name = $event" label="name"/>
In Input.vue component you have a prop "errorMsg" which I use but I don't see you use it in a template at all:
<template>

<div:class="wrapperClass">

<iv-if="icon":class="iconClasses"/>

<labelv-if="label && basic":class="labelClasses"@click="focus"ref="label":for="id">{{label}}</label>

<component

:is="tag"

:id="id"

:class="className"

:type="type"

:placeholder="placeholder"

:disabled="disabled"

@focus="focus"

@blur="blur"

@click="wave"

@change="onChange"

ref="input"

@input="onChange"

:name="name"

:required="required"

:checked="innerChecked"

:value="innerValue"

/>

<labelv-if="label && !basic":class="labelClasses"@click="focus"ref="label":for="id">{{label}}</label>

<slot></slot>

</div>

</template>

Mikołaj Smoleński staff answered 6 years ago


Hi there, We're still developing error messages in mdb-input. For this moment please use default bootstrap validation: https://mdbootstrap.com/docs/vue/forms/validation/ We'll add validation also to mdb-input in one of the next releases. Best Regards

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 4.6.0
  • Device: Notebook
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: Yes
  • Provided link: No
Tags