Apr 10th, 2012, 8:06 AM
I did manage to get this working! I used this in the form page template:
Code:
<script>
function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}
var company1 = unescape(getQuerystring('company'));
var address1 = unescape(getQuerystring('address'));
</script>
{{if $smarty.get.company != ""}}
<script>
$(function() {
$("input[name=comp]").val(company1);
});
</script>
{{/if}}
{{if $smarty.get.address != ""}}
<script>
$(function() {
$("input[name=add]").val(address1);
});
</script>
{{/if}}