Hi,
I have a form with an email address and some other stuff on it. The customer now would like to launch that form from an application and have some default values populated, so we're thinking of doing it using url parameters.
How should I do this?
I've tried adding a custom code block in onLoad and do something like <?php $form->data["input_email"]="blah" ?> in the code block but that didn't do the trick.
Any ideas would be welcome!
ee
I have a form with an email address and some other stuff on it. The customer now would like to launch that form from an application and have some default values populated, so we're thinking of doing it using url parameters.
How should I do this?
I've tried adding a custom code block in onLoad and do something like <?php $form->data["input_email"]="blah" ?> in the code block but that didn't do the trick.
Any ideas would be welcome!
ee
Another one answering his own question: it turns out correct spelling helps.
I added a Custom Code activity before the Show HTML in the OnLoad block, with the following contents:
<?php
$form->data['serial_number']=JRequest::getVar('sn');
?>
Mode could be view or controller, both seem to work.
I added a Custom Code activity before the Show HTML in the OnLoad block, with the following contents:
<?php
$form->data['serial_number']=JRequest::getVar('sn');
?>
Mode could be view or controller, both seem to work.
Hi erike24,
ChronoForms will automatically add any parameters from the URL to the $form->data array (add a Debugger action temporarily to check). If you use the same name in both you don't need the Custom Code. If the names are different then you can do:
Bob
ChronoForms will automatically add any parameters from the URL to the $form->data array (add a Debugger action temporarily to check). If you use the same name in both you don't need the Custom Code. If the names are different then you can do:
<?php
$form->data['serial_number'] = $form->data['sn'];
?>
Bob
This topic is locked and no more replies can be posted.