TypeError on submitting create form

TypeError on submitting create form

arcanumarcanum Posts: 15Questions: 4Answers: 0

Link to test case: sahr.it
Debugger code (debug.datatables.net): apipah
Error messages shown: Uncaught TypeError: d is undefined
Description of problem: after a while of configuration work I realized, that the create() function is no longer working and I was not able to figure out why. edit() is just working fine on all fields, but as soon as I hit submit ("speichern") in the creation form, editor stops working.

can you help me, please?

This question has an accepted answers - jump to answer

Answers

  • arcanumarcanum Posts: 15Questions: 4Answers: 0

    my bad, I forgot the credentials:
    user: test
    password: abcd1234

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    Can you give me a link to your page so I can take a look and debug it please?

    Thanks,
    Allan

  • arcanumarcanum Posts: 15Questions: 4Answers: 0

    Hi allen, thanks for your quick reply. It's right at sahr.it with the credentials from my comment

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Answer ✓

    Thanks! Its a really interesting one this. The error comes about due to the geburtstagskind_geschlecht field not having a value. If you add def: 'weiblich' to that field, the issue should be resolved at that point and complete the submission (although there is then an SQL error).

    The reason that field doesn't have a value is that it hasn't been inserted into the document (the field is hidden) and thus the browser doesn't automatically select the first value in the group.

    I need to have a little think about what the correct way to resolve this will be! For the moment, that workaround should do the job :)

    Allan

  • arcanumarcanum Posts: 15Questions: 4Answers: 0

    Hi Allan,

    you are a hero! Thank you so much. That field is a gender field and a preselected sex could be problematic, but unselectedValue: '' or unselectedValue: null did the trick just fine. How did you debug that one?
    The SQL-Error was just because I did not validate the date field as required yet, so that was ok.
    The whole thing will be an event calender for a non profit organisation with different event types that do share some fields and do not on others. And it should be customizable so all the fields are generated dynamically from the database, which makes it really complex.
    Maybe I'll write a blog post about some of the obstacles I came along :smiley:

    For now, I have to solve the problem of inline / bubble editing the fields in the child rows, but thats another topic :wink:

    Again, thank you very much for your time.

    Patrick

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    Excellent to hear!

    How did you debug that one?

    I sort of knew what area to look at because I could recall seeing a similar error in the past from incomplete data being submitted (I think at that time it was due to dynamically added fields). So it was a case of having a breakpoint in the code just before the error and knuckling down with the debugger, comparing it to one of our demo pages which I knew worked.

    Allan

Sign In or Register to comment.