Forums

how to call a chonoforms form within the php code?

AntonioGraca 15 Jan, 2014
Hi, Bob
Good year for you 😛

how to call (or Show) a chonoforms form within the php code?

I found this code, but.. and the rest of code?

$formname = 'publicar_"';
$MyForm =& CFChronoForm::getInstance($formname);
$MyForm->showForm($formname);


Thanks

António Graça
GreyHead 15 Jan, 2014
Hi António,

I don't know I've never tried to do this. What are you trying to do here? Can you use the Show Form action, or just redirect to the Form URL?

Bob
AntonioGraca 15 Jan, 2014
Hi, Bob

I have a Formatted text element where I have the php code that lists various main comments and responses to main comments. Now I wanted to put a form between from the main comments and responses to comments. I have the listing of the comments made ​​in php now needed to know how to call the form to stay below each main comment.
Something like that, but dont work...
echo "<form id=\"publicar_2\" action=\"http://infortreinoapoioaotreinador.com/index.php/publicar-resposta.html?id_pub2=$id_pub\" method=\"post\" onsubmit=\"return false;\">";


See the picture, please


Thanks
António Graça
GreyHead 15 Jan, 2014
Hi António,

I think I'd do what you have and add the form HTML directly with PHP. It would need to have the <form> tags though and some HTML a bit like this:
<?php
echo "<form id='publicar_2' action='http://infortreinoapoioaotreinador.com/index.php/publicar-resposta.html?id_pub2={$id_pub}' method='post' onsubmit='return false;' >
<textarea . . .></textarea>
<input type='submit' . . . />
</form>";
?>

And if this is inside another ChronoForm then the parent form *must* that the <form> Tags turned off as you cannot put one form inside another.

Bob
astichtmgr 16 Jan, 2014
I'm not good in language but I got interest adding reply button from main comment. How can it turn off the <form> tag?
This topic is locked and no more replies can be posted.