I would like to populate field values based on tokens in the url, like
The old way was a forming a url like
How would I get this done in Joomla with CF? I am not restricting this to registered users, so pulling from a DB table won't work. Any help is appreciated.
index.php?option=com_chronocontact&chronoformname=remove_request?Email=test@test.com=Dec07
I have searched, didn't find anything. I am converting a site to Joomla and need this functionality. I am a Joomla novice. The old way was a forming a url like
http://site.com/remove.htm?Email=test@test.com=Dec07
and using JS in the form <script type="text/javascript"><!--
a=location.href;if(a.indexOf("=")>-1){a=a.split("=");
document.forms[0].Email_address.value=a[1];
document.forms[0].Newsletter.value=a[2];}
// -->
</script>
How would I get this done in Joomla with CF? I am not restricting this to registered users, so pulling from a DB table won't work. Any help is appreciated.
Hi dtcinc,
But your url needs to be correctly formed - one ? at the beginning of the query string then a series of &name1=value1&name2=value2 pairs.
Bob
<?php
$email = getVar('Email');
?>
should give you a value from the url.But your url needs to be correctly formed - one ? at the beginning of the query string then a series of &name1=value1&name2=value2 pairs.
Bob
Bob,
I am adding this to the top of the form code
and get an error
I am a novice, so please don't assume I know what I'm doing... thanks
I am adding this to the top of the form code
<?php
$email = getVar('Email');
?>
and get an error
Call to undefined function getVar()
I am a novice, so please don't assume I know what I'm doing... thanks
I believe that should be something like this instead:
Then, to prefill your form (if I understood your request correctly), you'd do something like this:
<?php
$email = JRequest::getVar('Email');
?>
Then, to prefill your form (if I understood your request correctly), you'd do something like this:
Enter email address: <input type="text" name="email" value="<?php echo($email); ?>" />
This topic is locked and no more replies can be posted.