1

I've looked through some topics but they either have auto-submit where each checkbox is as a separate parameter in the URL or they need submit button. What I am trying to achieve is:

My current HTML form:

<form name="status" id="status" method="get">
    <input type="checkbox" name="status[]" value="0" onchange="document.getElementById('status').submit()" />
    <input type="checkbox" name="status[]" value="1" onchange="document.getElementById('status').submit()" />
    <input type="checkbox" name="status[]" value="2" onchange="document.getElementById('status').submit()" />
</form>

With this, I have auto-submit whenever a checkbox is checked, but I have an URL like ...&status%5B%5D=0&status%5B%5D=1

What I need is a comma-separated parameter in the URL like &status=0,1 while keeping the auto-submit option. Also, there are some more parameters in the URL, so this must be appended at the end while keeping the rest parameters.

Is this possible? I'm not familiar with javascript but I think there might be a way ...

2
  • Can you share your submit function code as well? Commented May 4, 2022 at 10:56
  • I think this post can help you with your query: stackoverflow.com/questions/11723297/… Commented May 4, 2022 at 11:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.