Returned data in the same page as form?

petasis 29 Oct, 2009
Hi all,

I am a ChronoForms newbie, and I want to use the component to create a form to test a web service.
So, I want the form to query the web service, and place the results (plain txt) in the same page as the form. Is this possible?
I don't want the form to send any e-mails or store anything in the database...

I have created an initial version of the form here:

http://www.intellitech.gr/index.php/lang-en/solutions-mainmenu-28/blog-processing

This simply uses the target tag on the form, to target a joomla wrapper, also on the page.
In general it does what I want, but is there a more elegant solution (that does not require a wrapper that needs to display something on page load)?
GreyHead 29 Oct, 2009
Hi petasis,

I'd do this by including the result in the form html itself. Use a php snippet to check if there is a result and only show it if something is there.

Bob

PS - or you could use the extra-code boxes to make the whole thing work with Ajax. Just a thought.
petasis 30 Oct, 2009
How can I check if there is a result?
Is it stored in a variable?
GreyHead 30 Oct, 2009
Hi petasis,

I've no idea how you are doing the remote query - so equally no idea what the result looks like :-(

Bob
petasis 03 Nov, 2009
The form just calls a REST service at:

http://www.intellitech.gr:8123/blog/process?uri=<the form uri>&action=<the form action>

This service returns a text file (and not html) with the results.
The form does a simple post to this url.
Is this clear?

When the form posts something, is the result stored anywhere? Or I need to use javascript for this, and perform the post action through javascript?
GreyHead 03 Nov, 2009
Hi petasis,

Can you capture the return into a JavaScript variable and then insert that into a div on the page?

Bob
petasis 07 Nov, 2009
I am not sure I know how🙄
Can it be done with chronoforms? Is there a tutorial?
GreyHead 07 Nov, 2009
Hi petasis,

There isn't any tutorial and I'm still exactly what needs to happen.

Bob
This topic is locked and no more replies can be posted.