jQuery UI Widgets Forums Editors CheckBox, RadioButton Submit form with checkbox

This topic contains 2 replies, has 2 voices, and was last updated by  sintes 5 months, 4 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Submit form with checkbox #104500

    sintes
    Participant

    Hello
    I have a form with several checkboxes as filter criteria. If the user click on a Checkbox the form will be submitted and the page refreshed.

    $(‘#filter32’).on(‘click’, function (event) {
    document.getElementById(“FormFilter”).submit();
    }

    This works fine on a pc. But not on a mobile phone, the click event doesn’t work.

    If I try the same with the ‘change’ event, the form is submitted on pc and mobile phone, but the values of the checkboxes are always ‘false’.
    How can I solve this problem?

    Submit form with checkbox #104563

    Peter Stoev
    Keymaster

    Hi sintes,

    For mobile phone, use ‘touchstart’ or ‘pointerdown’ events.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/

    Submit form with checkbox #104580

    sintes
    Participant

    Hi Peter

    Thank you for your answer. With ‘touchstart’ or ‘pointerdown’ events, I have the same problem that all form values are submitted with ‘false’ value. But I found an event ‘touchend’ and this one helps.
    So this is working:

    $('#filter32').on('click touchend', function (event) {
        document.getElementById("FormFilter").submit();
    });

    Many thanks for your support.
    Best regards,
    Christian

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.