Forums

Form redirect to index2.php

vbarlakoski 27 Jan, 2012
Hello!

I am using chronoform trough index2.php. But it redirects to the index.php url. How can i set the redirect always to be trough index2?
GreyHead 28 Jan, 2012
Hi vbarlakoski,

I'm not sure that I understand the question, please explain in more detail.

index2.php is a left-over from early Joomla! versions and can cause problems with server security.

Bob
vbarlakoski 29 Jan, 2012
Hello again!

The main idea is, to load form without any modules, except the main field of the form. That is ok. But when the form is executed, it redirects to thanks message, but with index.php link redirection, which loads all site with all modules as it is.

I want to use that form in iframe, thats why i use index2.php instead. But, when send button is clicked, inside iframe loads entire website with all elements.

So...

index2.php?option=com_chronocontact&Itemid=162 redirects to
index.php?option=com_chronocontact&task=send&chronoformname=koleda1&Itemid=162

and i want to be
index2.php?option=com_chronocontact&task=send&chronoformname=koleda1&Itemid=162 instead.
vbarlakoski 29 Jan, 2012
Ok!

I was looking others posts, and i found this as option:

<input type="hidden" name="tmpl" value="component" />

and $actionurl = $MyForm->formrow->submiturl.'&tmpl=component'; as well!

But because i dont want to change layout of all forms, i wonder if there is any action url to put into

Redirect URL:
or
Submit URL:
The form's "action" URL

I hope that you will guide me to the best solution,

Thanks!
GreyHead 30 Jan, 2012
Hi vbarlakoski,

The tmpl=component route is the correct one to use. index2.php is deprecated. You can make the change using JavaScript. There's an example from The ChronoForms Book here - scroll down to the section 'Keeping our options open' The code was for ChronoForms v3 but should be easy to adapt to CFv4.

Bob
vbarlakoski 30 Jan, 2012
Hi again Bob!

I saw the example, i`ve added the php in Form Html, and javascript in Form JavaScript, but, it still redirects without tmpl=component.

I am not using it with modal popup, just inside iframe. Maby thats the thing why the code is not working?
GreyHead 30 Jan, 2012
Hi vbarlakoski,

I'm confused about where this redirection is taking place? Where do you create the redirect URL? Exactly what code are you using?

Bob
vbarlakoski 30 Jan, 2012
Hi Bob!

I am not using any code for redirecting, but default as it is. When you click on submit button, automaticaly it redirects to Thanks message, but it does without tmpl=component.
GreyHead 30 Jan, 2012
Hi vbarlakoski,

I'm still confused. I can’t work out what is happening here. If the OnSubmit URL has the tmpl=component added then the template should not be included.

Bob
Max_admin 31 Jan, 2012
Hi,

if you have V4 then just add the code below to a "Custom element" in your form (or to your form code directly if you have custom form code) and that should do it:

<input type="hidden" name="tmpl" value="component" />


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.