sajid ullah
Coder
Hello everyone,
I have created a neat , responsive UI for a bill checker tool that allows users to switch between entering a Reference ID (14 digits) and a Customer ID (10 digits) using radio buttons. The data placeholder and maximum length are updated in real time from the input field. After the user clicks "Check Bill," the script verifies the input, creates a URL with the entered values, and opens it in a new window. It then attempts to auto-submit the form inside the opened page.
My main challenge:
Auto-submitting a form on the opened page is not reliable and is often blocked due to cross-origin policies.
Questions for the community:
What's a trustworthy way to simulate "auto-submit" a form and pass data between tabs/windows across domains?
Do you have any best practices or workarounds that you've used in this type of situation?
Is there a better way to do UX and code optimisation for my current flow?
Summary of what I've done:
Radio toggle updates placeholder of input and max length of input
Before it does anything else, it checks to see if the number of digits is valid.
Builds URL dynamically with query string parameters.
Open another tab and script, and try to auto-submit the form.
I will be able to release the full code if there is any interest. I'd love to get the benefit of your thoughts and advice!
I appreciate any help you can provide. 🙏
#JavaScript # CrossOrigin #FormSubmission #WebDev # UI #Frontend
I can also provide a live demo or a repository link if you'd like. Just let me know!
I have created a neat , responsive UI for a bill checker tool that allows users to switch between entering a Reference ID (14 digits) and a Customer ID (10 digits) using radio buttons. The data placeholder and maximum length are updated in real time from the input field. After the user clicks "Check Bill," the script verifies the input, creates a URL with the entered values, and opens it in a new window. It then attempts to auto-submit the form inside the opened page.
My main challenge:
Auto-submitting a form on the opened page is not reliable and is often blocked due to cross-origin policies.
Questions for the community:
What's a trustworthy way to simulate "auto-submit" a form and pass data between tabs/windows across domains?
Do you have any best practices or workarounds that you've used in this type of situation?
Is there a better way to do UX and code optimisation for my current flow?
Summary of what I've done:
Radio toggle updates placeholder of input and max length of input
Before it does anything else, it checks to see if the number of digits is valid.
Builds URL dynamically with query string parameters.
Open another tab and script, and try to auto-submit the form.
I will be able to release the full code if there is any interest. I'd love to get the benefit of your thoughts and advice!
I appreciate any help you can provide. 🙏
#JavaScript # CrossOrigin #FormSubmission #WebDev # UI #Frontend
I can also provide a live demo or a repository link if you'd like. Just let me know!