Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Argument 1 of Node.contains is not an object. #325

Closed
GTheron opened this issue Jan 28, 2014 · 2 comments
Closed

Error: Argument 1 of Node.contains is not an object. #325

GTheron opened this issue Jan 28, 2014 · 2 comments

Comments

@GTheron
Copy link

GTheron commented Jan 28, 2014

I've started using pickadate for forms in my website.

I'm using the Symfony2 php framework, and for the graphical side I'm using the twitter bootstrap 2.

I am rendering a form with date and time inputs. When I use pickadate on a date input, the field appears as disabled (as pickadate makes it), and on click the widget appears as normal. If I navigate with the keyboard arrows and select a date with enter, it works fine, the input is updated with the selected date.

However, if I select the date with a click, I get the following error:

TypeError: Argument 1 of Node.contains is not an object.

And then the date is not selected, although the widget disappears as though it had been.

I have tried using a container, as follows:

<script>
    $(function(){
        $('#reservation_form_dateStart_date').pickadate({
            format: 'dd/mm/yyyy',
            clear: '',
            container: '#dateStartOutlet'
    });
    });
</script>
<div class="control-group">
    <label class="required">Début</label>
    <div class="controls">
        <div id="reservation_form_dateStart">
            <input id="reservation_form_dateStart_date" type="text" value="28/01/2014" required="required" name="reservation_form[dateStart][date]">
            <input id="reservation_form_dateStart_time" type="time" value="16:12" required="required" name="reservation_form[dateStart][time]">
       </div>
       <div id="dateStartOutlet">
       </div>
</div>

I am unable to determine where the issue comes from. It seems to me that the input cannot be found, and therefore cannot be updated, but I do not know what causes this.
Any help would be appreciated.

@amsul
Copy link
Owner

amsul commented Jan 31, 2014

Can you please submit a reduced test case reproducing this issue?

@GTheron
Copy link
Author

GTheron commented Jan 31, 2014

I have been able to make a jsfiddle of it:

http://jsfiddle.net/4YaEL/

The error only occurs on Firefox though (Firefox 26.0).
I've had to paste all the js and css (except for legacy) in though, so sorry about that. The same init script is located at the very end of the js section.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants