-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem when a template is changed #19
Comments
No idea what could be wrong. Does |
I inserted this function in the code and it returns me the correct form ! // Get the form as string
$objForm->addFormToTemplate($this->Template);
echo $objForm->generateForm() ; And $this->Template = jb_jobForm ( But I have the first form in the frontend... The first overwrites the second. I use this code on each template <div class="form">
<form action="<?php echo $this->action; ?>" method="post">
<div class="formbody">
<input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formId; ?>" />
<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}" />
<table summary="Form fields">
<?php foreach ($this->fields as $objWidget): ?>
<?php echo $objWidget->parse(); ?>
<?php endforeach; ?>
</table>
<div class="submit_container">
<input type="submit" class="submit" value="<?php echo $this->submit; ?>" />
</div>
</div>
</form>
</div> |
I think there is some mistake in your code. Maybe try to do the following: $objTemplate = new FrontendTemplate('jb_jobForm');
// Initialize form, etc.
$objForm->addFormToTemplate($objTemplate);
$this->Template = $objTemplate; |
No result... I use three forms with Haste and if I remove the first, the other forms work perfectly. The method for changing the template is the same... Thank you for the help. |
I suggest to make independent templates for each form. This way you will avoid strange errors like above. $objTemplateSearch
$objFormSearch
// ...
$objTemplateJob
$objFormJob
// And in the main template, depending on the situation:
$this->Template->form = $objTemplateSearch->parse(); |
Hi, I found a solution by replacing in the main template :
With
It works... Thanks |
Hi,
I have a problem when I change a template. To explain this, my module display a search form and a link for creating a new job :
First function :
If I use this link I change the template with a new form.
Second function :
The template is changed. That's OK. But not the form. The first form is inserted into the second form.
Normally I should have "title", "description", ... but I have "contract_type", "categories", ... and the id of the form is not changed.
Do you have an idea of the problem ?
Thx
The text was updated successfully, but these errors were encountered: