Getting Error With Impomptu I don't understand

85 Views Asked by At

I'm trying to use Impromptu in the middle of a form tag. I basically have the following code and I get the error below. I don't get the error if I replace my .ajax call with a simple alert.

Basically, I'm just wanting to ask a question, get an answer, then pass that answer to an ajax call and then post a confirmation and close.

    $("#assignkidsparent").click(function(event) {
        event.stopPropagation();
        event.preventDefault();
        var parentUsernameForm = {
            state0: {
                title: 'Enter Username of Parent (Email Confirmation Will Be Sent)',
                html: '<label>Parent SV Code Camp Username:<input type="text" name="username" value=""></label><br />',
                buttons: { Send: 1 },
                submit: function (e, v, m, f) {
                    var username = f.username;
                    e.preventDefault();
                    event.stopPropagation();
                    $.ajax({
                        type: 'POST',
                        url: '/rpc/account/UpdateAttendeeRegJquery',
                        data: {
                            ParentUsername: username,
                            AttendeesId: $('#RegisterUserInfoLoggedIn_AttendeesId')
                        },
                        success: function(data) {
                            $.prompt('success');
                        },
                        error: function (result) {
                            $.prompt('error');
                        }
                    });
                }
            }
        };
        $.prompt(parentUsernameForm);

    });

caught InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('hidden') does not support selection.

0

There are 0 best solutions below