v-mask icon indicating copy to clipboard operation
v-mask copied to clipboard

Get raw value

Open johnmerced-ks opened this issue 7 years ago • 22 comments

Is there a way to get the raw value without any formatting?

Raw value: 5555555555 Formatted: 555-555-5555

Regards,

johnmerced-ks avatar May 10 '17 15:05 johnmerced-ks

+1 - would like to know if this is possible

wdkenn avatar May 12 '17 17:05 wdkenn

Currently it's not stored inside v-mask. Sounds like a feature request

probil avatar May 24 '17 20:05 probil

Agree. Would be great that the v-model value reflects the raw input rather than the formatted input.

vpratfr avatar May 07 '18 16:05 vpratfr

It's going to be fixed in #278

probil avatar Oct 23 '18 14:10 probil

+1 on this. currently using v-mask as directive i was looking for something like v-mask.raw="'##-##-##'"

displayed value = '11-22-33' actual value in model = 112233

thanks

paolog22 avatar Nov 08 '19 10:11 paolog22

It would be nice a directive "masked=true|false" to update the v-model with/without the mask.

thanks!

mrother avatar Mar 13 '20 13:03 mrother

We still cant do this? lol

Update: you can use my repo, it create a data attribute on the input with the name of unmasked and you can retrieve the raw value from it

https://github.com/bw2tecnologia/v-mask

+1 for this. If the directive could return the raw value this would be the perfect masking choice for vue

edsonfeimberg avatar Sep 24 '20 01:09 edsonfeimberg

+1

aligzl avatar Feb 16 '21 16:02 aligzl

+11111111

Sovai avatar Jul 06 '21 10:07 Sovai

+1

mlopez-forevercar avatar Jul 06 '21 16:07 mlopez-forevercar

+1

Victor7095 avatar Jul 07 '21 16:07 Victor7095

For anyone looking for a simple solution!

You can make a simple mask-field component where you can parse raw value from masked value. image

getRawValue(value) {
  const rawValueArray = []
  this.mask.split('').forEach((character, i) => {
    if (character === '#') {
      charArray.push(value[i])
    }
  })

  return rawValueArray.join('')
},

davidurco avatar Jul 16 '21 13:07 davidurco

This would be incredible if is native!!

NathanAlcantara avatar Nov 04 '21 01:11 NathanAlcantara

Any progress for this one?

Rifaldikn avatar Dec 18 '21 14:12 Rifaldikn

+1

shaxzodbek-uzb avatar Jan 06 '22 11:01 shaxzodbek-uzb

+1

cristianpelaezm avatar Mar 11 '22 21:03 cristianpelaezm

+1

johngerome avatar Mar 16 '22 01:03 johngerome

bump

rmarmitt avatar Mar 30 '22 12:03 rmarmitt

+1

mixaadev avatar Jul 06 '22 14:07 mixaadev

Would be greatly appreciated!

baartho avatar Jul 21 '22 04:07 baartho

+1

stanleygomes avatar Mar 29 '24 06:03 stanleygomes