Forums

use javascript with ChronoForms

federcla 06 Mar, 2013
Hi, I would like to use javascript with ChronoForms

I would like to create a system similar to that used in the action of ChronoForms, when you configure the action

configured by clicking the icon to activate the JavaScript and open the new page

http://forum.joomla.gen.tr/attachments/iletisim-formlar/368d1329147463t-chronoforms-e-posta-sorunu-resim4.jpg

I need to replicate this system but do not know how, could you help me?

I do not ask code, but help on how to think and make a js alert compatible with Joomla and ChronoForms

tks
GreyHead 06 Mar, 2013
Hi federcla,

The form in your image is loading in a Modal window (or Lightbox). Please see this FAQ

Bob
federcla 07 Mar, 2013
tks for the information, very useful

but it don't work๐Ÿ˜Ÿ

i have insert in a form (action custom code) the code for open a modal window, but it open e new page


<?php
JHTML::_('behavior.modal');

echo '<a class="modal" href="index.php?option=com_chronoforms&chronoform=Read_Message&tmpl=component" rel="{handler: iframe, size: {x: 600, y: 600}}">'.$messaggi['2'].'</a>';
?>


i don't know why
GreyHead 07 Mar, 2013
Hi federcla,

I don't either :-(

Bob
federcla 07 Mar, 2013
:)

now it work!๐Ÿ™‚

i have modify the code

<?php
JHTML::_('behavior.modal');
?>
<a class="modal" href="index.php?option=com_chronoforms&chronoform=Read_Message&tmpl=component" rel="{handler: 'iframe', size: {x: 600, y: 600}}">'<?php echo $messaggi['2'];?>'</a>


but now i have another problem, i want send a variable in a new form, i used this system but it is not good

<a class="modal" href="index.php?option=com_chronoforms&chronoform=Read_Message&tmpl=component&nir="<?php $messaggi['0'];?> rel="{handler: 'iframe', size: {x: 500, y: 500}}"><?php echo $messaggi['3'];?></a>

after the
tmpl=component
i have insert
&nir="<?php $messaggi['0'];?>
for get this value in a destination form i used
$id  = JRequest::getVar('nir', '', 'get');


but it does not take the variable

can you help me?
GreyHead 07 Mar, 2013
Hi federcla,

You need an 'echo' in the PHP
<?php echo $messaggi['0']; ?>

Bob
federcla 11 Mar, 2013
<?php echo $messaggi['0']; ?>

yes it's true, sorry for my stupid question :p

now i have another problem, i have write a simple code for read a list of messages, there is a list with all message and the object is bold if i don't have read the message

example:
2013-03-11 message_4
2013-03-11 message_3
2013-03-11 message_2
2013-03-11 message_1

when i click on the object i open the modal window, but i want change the status of the message, can i send a variable from modal window to the ChronoForms and after reload the page?

tks
GreyHead 11 Mar, 2013
Hi federcla,

Yes you can, I'd probably make a link to do that and have the link URL go to a form event with a Custom Code action to do . . .

Bob
federcla 11 Mar, 2013
I had already thought about using a button at the bottom of the page, but I wanted to know if i can use the x-button of the modal window or it is only for closed the window

tks
GreyHead 11 Mar, 2013
Hi federcla,

I don't know. It's possible to do some clever things with JavaScript to add new URLs. Perhaps you could add an action or link to the close button to go to a different URL in the parent window and show a form event that way.

Bob
federcla 11 Mar, 2013
I tried to put a button in the modal, but I do not close the window
This topic is locked and no more replies can be posted.