Solved

App Has Period?

Posted on 2015-02-19
2
53 Views
Last Modified: 2015-02-21
I have never seen anything like this. When I add a child record to my main form, the Birthdate field loads with a period in the input box. I have no idea how this is happening. Has anyone in this community seen anything like this? What could be causing it? I promise this is NOT a spoof or joke.

HTML
<input name="Birthdate" class="form-control input-sm" data-bind="attr:{'id': 'Birthdate_' + $index()}, value: Birthdate, date: Birthdate, format: 'MM DD YYYY', event: {change: flagIndividualsAsEdited}" placeholder="Birthdate"/>
                        </td>

Open in new window


JS function adding child viewModel and defaults.
        self.addFamilyMember = function() {
            var individuals = new IndividualsViewModel({ Id: -1, FirstName: "", MiddleName: "", LastName: "", Gender: "", PhoneNumber: "0000000000", Email: "", Birthdate: "", AdultBirthdateDecline: 0, Ethnicity: "", USTANumber: "", FamilyRole: "", RelationshipType: "", ObjectState: ObjectState.Added });
            self.Individuals.push(individuals);
        },

Open in new window


THE DEMON PERIOD!
Input form with random period in Birthdate field.
0
Comment
Question by:wdarnellg
2 Comments
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 40622003
That's not a period...that's a hyphen.  It looks like you are using a library to enforce a particular formatting on the value of that input box (date formatting, probably).  The hyphen could be an artifact of the library trying to format a NULL value into a date.  Or perhaps the library properly detects the NULL value, and purposefully inserts the hyphen to signify it.

In any case, you'll need to look through the library manipulating that input.
0
 

Author Comment

by:wdarnellg
ID: 40622993
That was it. It was this part code that formats the date:
       var value = valueAccessor();
            var pattern = allBindings.format || "MM/DD/YYYY";
            var valueUnwrapped = ko.utils.unwrapObservable(value);

            var output = "-";
            if (valueUnwrapped !== null && valueUnwrapped !== undefined && valueUnwrapped.length > 0) {
                output = moment(valueUnwrapped).format(pattern);
            }
            if ($(element).is("input") === true) {

                $(element).val(output);
            } else {
                $(element).text(output);
            }

Open in new window


Thanks for the insight!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now