Self-posting forms in C5
Permalink
Is it possible to have a self-posting form in an HTML or other block?
I just want to put a little dropdown box on a page that posts the selected value back to itself and redisplays the page content based on what was selected.
This is basically a currency selector on a price page.
What are the options?
I just want to put a little dropdown box on a page that posts the selected value back to itself and redisplays the page content based on what was selected.
This is basically a currency selector on a price page.
What are the options?
Any takers? Code snippets? Add-ons?
To do this you will need some coding.
The self posting part would be a jQuery event handler attached to the change event of the select then triggering submit on the form.
The form and response would be coded in php and could either be a single page or a custom block, coded to output the selector when called with no parameters, or to output the details when called with the select data.
You could optimise the user experience by doing it by AJAX rather than a full page load.
You could use some off-the-shelf building blocks picked from (depending on design choices) designer content, blocks-by-ajax, magic data, jQuickie, magic toggle.
But ultimately it depends on writing some code to either add detail to blocks or link them together.
The self posting part would be a jQuery event handler attached to the change event of the select then triggering submit on the form.
The form and response would be coded in php and could either be a single page or a custom block, coded to output the selector when called with no parameters, or to output the details when called with the select data.
You could optimise the user experience by doing it by AJAX rather than a full page load.
You could use some off-the-shelf building blocks picked from (depending on design choices) designer content, blocks-by-ajax, magic data, jQuickie, magic toggle.
But ultimately it depends on writing some code to either add detail to blocks or link them together.
Thanks for the reply. I am no coder, although once I have an example I can usually adapt it. I'll keep looking...
Looking at your case, I don't see any solution that would do that out of the box with no coding involved.
I beleive I can create an addon for this kind of need, but it will require me some time to think about a more general case.
How long do you have ?
I beleive I can create an addon for this kind of need, but it will require me some time to think about a more general case.
How long do you have ?
IMO, from what you say, not all data on the page are to be reloaded based on that value.
I think you should just have the block depending on that value refreshed by AJAX, can be done in different ways (like John says), I would personally code an addon for that kind of need.
Actually, if you can PM me a more detailed description (with examnple link), I may eventually code that addon if you really need it.
I think you should just have the block depending on that value refreshed by AJAX, can be done in different ways (like John says), I would personally code an addon for that kind of need.
Actually, if you can PM me a more detailed description (with examnple link), I may eventually code that addon if you really need it.