Click here to Skip to main content
15,881,852 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Load Webpage in JS condition Pin
Richard Deeming17-Aug-20 21:46
mveRichard Deeming17-Aug-20 21:46 
AnswerRe: Load Webpage in JS condition Pin
Otekpo Emmanuel21-Aug-20 4:18
Otekpo Emmanuel21-Aug-20 4:18 
QuestionBeginner-Help with parsing out multi select drop downs Pin
Member 1491294312-Aug-20 8:01
Member 1491294312-Aug-20 8:01 
Questiondrawing-a-polygon-on-image-inside-canvas-after-zoom-in-out-and-panning Pin
Member 1491178110-Aug-20 23:31
Member 1491178110-Aug-20 23:31 
QuestionJquery problem to FIX ! Pin
imothep857-Aug-20 0:25
imothep857-Aug-20 0:25 
Rant[REPOST] Jquery problem to FIX ! Pin
Richard Deeming7-Aug-20 1:00
mveRichard Deeming7-Aug-20 1:00 
AnswerRe: Jquery problem to FIX ! Pin
jkirkerx7-Aug-20 9:28
professionaljkirkerx7-Aug-20 9:28 
QuestionMasking Phone in Ember JS Pin
simpledeveloper24-Jul-20 11:02
simpledeveloper24-Jul-20 11:02 
Hi, I am trying to mask a Phone number in a input field, can somebody please help me in this regards. Here is my code for the html (or hbs file)
    <label class="control-label">Phone</label>
    {{masked-input mask='(999) 999-9999'
                   value=model.Address.Phone
                   input-format='regex'
                   input-filter='\(*[0-9]{3}\) [0-9]{3}-[0-9]{4}'
                   input-filter-message='Phone number is not valid.'
                   class='form-control phone masked'
                   maxlength="14"}}
</div>

And my component definition is as below:
export default () => {
    IMS.registerComponent("masked-input", {
        tagName: 'input',
        attrParams: ['required', 'title', 'name', 'placeholder'],
        loaded: false,
        prop: Ember.observer(
            'required',
            'title',
            'name',
            'placeholder',
            'value',
            function () {
                var scope = this;
                $(this.element).val(Ember.get(scope, 'value'));
                var stamp = new Date();
                if (Ember.get(scope, 'loaded') == true) {

                    var element = $(this.element);
                    var attrs = Ember.get(this, 'attrParams');
                    attrs.forEach(function (attr) {
                        var value = Ember.get(scope, attr);
                        if (value == '' | value == null) {
                            element.removeAttr(attr);
                        } else {
                            element.attr(attr, value);
                        }
                    })
                }
            }),
        observeMask: Ember.observer('mask', function () {
            var scope = this;
            $(this.element).inputmask({
                mask: Ember.get(scope, 'mask')
            });
        }),
        didInsertElement: function () {
            var scope = this;

            setTimeout(function () {
                var value = Ember.get(scope, 'value');
                var element = $(scope.element);
                var change = function () { Ember.set(scope, 'value', element.val()); }
                element.val(Ember.get(scope, 'value'));
                element.attr('type', 'text');
                element.change(change);
                // element.keypress(change);
                Ember.set(scope, 'loaded', true);
                scope.observeChanges();
                element.inputmask({
                    mask: Ember.get(scope, 'mask')
                });

                element.attr('input-format', Ember.get(scope, 'input-format'));
                element.attr('input-filter', Ember.get(scope, 'input-filter'));
                element.attr('input-filter-message', Ember.get(scope, 'input-filter-message'));

            }, 250);
        }
    })
}

Can somebody please help me why is it not working? Thanks in advance.
Questionhow to generate new products, confirm these products are not duplicates from the immediate previous set? Pin
hamzh sami21-Jul-20 10:28
hamzh sami21-Jul-20 10:28 
QuestionHi , can someone help me with this task Pin
Member 1489271418-Jul-20 0:22
Member 1489271418-Jul-20 0:22 
AnswerRe: Hi , can someone help me with this task Pin
Richard MacCutchan18-Jul-20 0:56
mveRichard MacCutchan18-Jul-20 0:56 
JokeRe: Hi , can someone help me with this task Pin
Peter_in_278018-Jul-20 1:34
professionalPeter_in_278018-Jul-20 1:34 
GeneralRe: Hi , can someone help me with this task Pin
Richard MacCutchan18-Jul-20 1:35
mveRichard MacCutchan18-Jul-20 1:35 
QuestionDOM Functions Pin
Member 1488961215-Jul-20 3:09
Member 1488961215-Jul-20 3:09 
AnswerRe: DOM Functions Pin
Richard MacCutchan15-Jul-20 3:49
mveRichard MacCutchan15-Jul-20 3:49 
QuestionPoints Scaling issue on Leaflet Pin
LilFlower13-Jul-20 0:52
LilFlower13-Jul-20 0:52 
AnswerRe: Points Scaling issue on Leaflet Pin
jkirkerx15-Jul-20 12:33
professionaljkirkerx15-Jul-20 12:33 
QuestionJavascript summary with prompt Pin
atomattacker-png11-Jul-20 11:56
atomattacker-png11-Jul-20 11:56 
AnswerRe: Javascript summary with prompt Pin
Richard MacCutchan11-Jul-20 23:00
mveRichard MacCutchan11-Jul-20 23:00 
GeneralRe: Javascript summary with prompt Pin
atomattacker-png11-Jul-20 23:38
atomattacker-png11-Jul-20 23:38 
GeneralRe: Javascript summary with prompt Pin
Richard MacCutchan12-Jul-20 0:26
mveRichard MacCutchan12-Jul-20 0:26 
QuestionHow to access object literal property's value inside the object literal function? Pin
Member 139548909-Jul-20 9:40
Member 139548909-Jul-20 9:40 
QuestionRe: How to access object literal property's value inside the object literal function? Pin
ZurdoDev9-Jul-20 10:13
professionalZurdoDev9-Jul-20 10:13 
AnswerRe: How to access object literal property's value inside the object literal function? Pin
Andre Oosthuizen9-Jul-20 17:14
mveAndre Oosthuizen9-Jul-20 17:14 
GeneralRe: How to access object literal property's value inside the object literal function? Pin
Member 1395489011-Jul-20 8:34
Member 1395489011-Jul-20 8:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.