react-maskedinput icon indicating copy to clipboard operation
react-maskedinput copied to clipboard

Getting the pure value without the mask

Open shin-monkey opened this issue 9 years ago • 3 comments

Is it possible? Couldn't find any way to do it.

shin-monkey avatar Aug 31 '16 21:08 shin-monkey

Use <Masker ref="masker" />, then when you need to get pure value use this.refs.masker.mask.getRawValue().

mohithg avatar Nov 02 '16 23:11 mohithg

Hey @shin-monkey @mohithg can you give code example where you used this.refs.masker.mask.getRawValue(). Sorry I am new to react and could not figure out where to use it. This is my masked input

                    <MaskedInput mask="1111111111"
                                 onBlur={this.validate}
                                 className="form-control"
                                 placeholder="Phone"
                                 name="PHONE"
                                 onChange={this.changeInput}/>

hhsadiq avatar Feb 18 '17 14:02 hhsadiq

@hhsadiq

  <MaskedInput  ref="masker"
                             mask="1111111111"
                             onBlur={this.validate}
                             className="form-control"
                             placeholder="Phone"
                             name="PHONE"
                             onChange={this.changeInput}/>

shin-monkey avatar Feb 19 '17 00:02 shin-monkey