Forums

How to get info from URL to pre populate fields

rashleigh 21 Apr, 2010
Hi All,

I am trying to get information from a emailed url to populate the fields in my chronoform
Sofar i have been able to get it to work outside joomla but no succes using chronoforms

this is the url example:
http://www.domain.com/index.php?option=com_chronocontact&chronoformname=vakantieopgave&Voornaam=Hans&Achternaam=Hendriksma

this is the code in the form
<div  class="form_item"><div class="form_element cf_text">
  <h1><span class="cf_text">Vakantieopgave Kinderopvang Dikke Maatjes B.V.</span></h1>
</div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Voornaam Kind:</label><input class="cf_inputbox" maxlength="150" size="30" id="text_1" name="text_1" type="text" value='<?php echo $Voornaam; ?>'></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_textbox"><label class="cf_label">Achternaam Kind:</label><input class="cf_inputbox" maxlength="150" size="30" id="text_2" name="text_2" type="text" value='<?php echo $Achternaam; ?>'></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_dropdown"><label class="cf_label">Groep:</label><select multiple="multiple" class="cf_inputbox validate-selection" id="select_3" size="10" name="select_3[]"><option value="Banaantjes">Banaantjes</option><option value="Druifjes">Druifjes</option><option value="Aardbeitjes">Aardbeitjes</option><option value="Mandarijntjes">Mandarijntjes</option><option value="Peertjes">Peertjes</option><option value="KDV Molukkenstraat">KDV Molukkenstraat</option><option value="KDV Kerkweg">KDV Kerkweg</option><option value="NSO Orion">NSO Orion</option><option value="NSO brederode">NSO brederode</option><option value="NSO Kerkweg">NSO Kerkweg</option></select><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" width="16" border="0" height="16"></a><div  class="tooltipdiv">Groep: :: Kies hier de groep van uw kind</div></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_datetimepicker"><label class="cf_label">is op vakantie vanaf:</label><input onclick="new Calendar(this);" class="cf_datetime" size="20" id="date_4" name="date_4" type="text"></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_datetimepicker"><label class="cf_label">tot:</label><input onclick="new Calendar(this);" class="cf_datetime" size="20" id="date_6" name="date_6" type="text"></div><div class="clear">
  <input type="submit" name="submit" id="submit" value="Verstuur vakantieopgave">
</div></div>


Hope you can give me some pointers
Thanks in advange
Hans
GreyHead 21 Apr, 2010
Hi Hans,

You need to pull the values from the $_GET array at the start of the Form HTML.
<?php
if ( !$mainframe->isSite() ) { return; }
$Voornaam = JRequest::getString('Voornaam', '', 'get');
$Achternaam = JRequest::getString('Achternaam', '', 'get');
?>

Bob
rashleigh 22 Apr, 2010
Hi Bob,

This works for me.
Thanks for sharing the solution with me
Great

Hans
This topic is locked and no more replies can be posted.