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

.attr function not working inside ready after migration #432

Closed
chanodya opened this issue May 15, 2021 · 4 comments
Closed

.attr function not working inside ready after migration #432

chanodya opened this issue May 15, 2021 · 4 comments

Comments

@chanodya
Copy link

@chanodya chanodya commented May 15, 2021

var url = $('#essionSearchForm').attr('action');

This is not working inside ready state after migration.

@mgol
Copy link
Member

@mgol mgol commented May 15, 2021

Please provide a test case on JS Bin. Right now there are too few details here to do anything.

@chanodya
Copy link
Author

@chanodya chanodya commented May 15, 2021

var url = $('#sessionSearchForm').attr('action');
$(document).ready(function () {

$('#searchBtn').live('click', function (event) {

    $('#sessionSearchForm input[type=text]').not('#searchSession_dueDate, #searchSession_scheduledDate_from, #searchSession_scheduledDate_to').each(function () {
        if ($(this).val() === typeHint) {
            $(this).val('');
            $(this).nextAll('label').removeClass('active');
            $(this).removeClass('valid');
        }
    });

    $('#searchSession_name').removeClass('valid');

    if ($('#sessionSearchForm').valid() && $('#searchSession_scheduledDate_to').valid()) {
        $('#hdnAction').val('search');

        listPage.searchFlag = 'true';
        // var url = $('#sessionSearchForm').attr('action');
        var type = "POST";
        var data = $('#sessionSearchForm').serialize();
        var dataType = 'json';
        listPage.updateListComponent(url, type, data, dataType, '', true);
        $('#searchForm').closeModal();
    }

when adding var url = $('#sessionSearchForm').attr('action'); outside ready it's working. This is using with ajax

@mgol
Copy link
Member

@mgol mgol commented May 16, 2021

As I wrote above, please create a full working test case on a service like JS Bin. Providing code snippets here on GitHub would require us to spend significant time on trying to re-create what you experience. That's too much friction.

@mgol
Copy link
Member

@mgol mgol commented Aug 25, 2021

Closing as the test case has not been provided. We can reopen if we get one.

@mgol mgol closed this Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants