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

The form fields configured via form field are not submitted. #44

Open
KES777 opened this issue Jan 19, 2025 · 3 comments
Open

The form fields configured via form field are not submitted. #44

KES777 opened this issue Jan 19, 2025 · 3 comments
Assignees
Labels
bug Something isn't working feature/change request

Comments

@KES777
Copy link

KES777 commented Jan 19, 2025

Describe the bug

<form id="test"></form>
<input form="test" name="xxx">

If this from will be submitted via FormDataJson then xxx field will be skipped.
Though if I submit form using regular API, then xxx field is submitted

To Reproduce
See above.

Please make it to submit fields which refers to form/element by id.

@KES777 KES777 added the bug Something isn't working label Jan 19, 2025
@KES777
Copy link
Author

KES777 commented Jan 19, 2025

I just tried this selector document.querySelectorAll( 'select[form=' +el.id +'], textarea[form=' +el.id +'], input[form=' +el.id +'], button[form=' +el.id +']') around this code from debugger and it works.

628-631:

    let inputs = el.querySelectorAll('select, textarea, input, button')
    let inputTree = {}
    let autoIncrementCounts = {}
    for (let i = 0; i < inputs.length; i++) {

Though we need to filter out duplicate inputs when both elements from existing selector and mine selector were merged into one array.

@brainfoolong
Copy link
Owner

brainfoolong commented Jan 20, 2025

Hi. I guess with "submitted" you mean it's not found by "toJson" or "fromJson". FormDataJson itself cannot submit forms.

I never heard of the "form" attribute before, but it is in fact a valid input attribute an it works exactly how you describe.

I will see if i can integrate that. I am just very limited in time, so it may take some time.

@KES777
Copy link
Author

KES777 commented Jan 21, 2025

Your response time is the best in compare to other projects! Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature/change request
Projects
None yet
Development

No branches or pull requests

2 participants